-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run prettier on cypress folder (#4510)
* Run prettier on cypress folder * Test Restyled * Revert "Test Restyled" This reverts commit 13d4396.
- Loading branch information
1 parent
329e859
commit 29582e3
Showing
39 changed files
with
1,278 additions
and
1,217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import { createQuery } from '../../support/redash-api'; | ||
import { createQuery } from "../../support/redash-api"; | ||
|
||
describe('Create Alert', () => { | ||
describe("Create Alert", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
|
||
it('renders the initial page and takes a screenshot', () => { | ||
cy.visit('/alerts/new'); | ||
cy.getByTestId('QuerySelector').should('exist'); | ||
cy.percySnapshot('Create Alert initial screen'); | ||
it("renders the initial page and takes a screenshot", () => { | ||
cy.visit("/alerts/new"); | ||
cy.getByTestId("QuerySelector").should("exist"); | ||
cy.percySnapshot("Create Alert initial screen"); | ||
}); | ||
|
||
it('selects query and takes a screenshot', () => { | ||
createQuery({ name: 'Create Alert Query' }).then(({ id: queryId }) => { | ||
cy.visit('/alerts/new'); | ||
cy.getByTestId('QuerySelector').click().type('Create Alert Query'); | ||
it("selects query and takes a screenshot", () => { | ||
createQuery({ name: "Create Alert Query" }).then(({ id: queryId }) => { | ||
cy.visit("/alerts/new"); | ||
cy.getByTestId("QuerySelector") | ||
.click() | ||
.type("Create Alert Query"); | ||
cy.get(`.query-selector-result[data-test="QueryId${queryId}"]`).click(); | ||
cy.getByTestId('Criteria').should('exist'); | ||
cy.percySnapshot('Create Alert second screen'); | ||
cy.getByTestId("Criteria").should("exist"); | ||
cy.percySnapshot("Create Alert second screen"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
import { createAlert, createQuery } from '../../support/redash-api'; | ||
import { createAlert, createQuery } from "../../support/redash-api"; | ||
|
||
describe('Edit Alert', () => { | ||
describe("Edit Alert", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
|
||
it('renders the page and takes a screenshot', () => { | ||
createQuery({ query: 'select 1 as col_name' }) | ||
.then(({ id: queryId }) => createAlert(queryId, { column: 'col_name' })) | ||
it("renders the page and takes a screenshot", () => { | ||
createQuery({ query: "select 1 as col_name" }) | ||
.then(({ id: queryId }) => createAlert(queryId, { column: "col_name" })) | ||
.then(({ id: alertId }) => { | ||
cy.visit(`/alerts/${alertId}/edit`); | ||
cy.getByTestId('Criteria').should('exist'); | ||
cy.percySnapshot('Edit Alert screen'); | ||
cy.getByTestId("Criteria").should("exist"); | ||
cy.percySnapshot("Edit Alert screen"); | ||
}); | ||
}); | ||
|
||
it('edits the notification template and takes a screenshot', () => { | ||
it("edits the notification template and takes a screenshot", () => { | ||
createQuery() | ||
.then(({ id: queryId }) => createAlert(queryId, { custom_subject: 'FOO', custom_body: 'BAR' })) | ||
.then(({ id: queryId }) => createAlert(queryId, { custom_subject: "FOO", custom_body: "BAR" })) | ||
.then(({ id: alertId }) => { | ||
cy.visit(`/alerts/${alertId}/edit`); | ||
cy.getByTestId('AlertCustomTemplate').should('exist'); | ||
cy.percySnapshot('Alert Custom Template screen'); | ||
cy.getByTestId("AlertCustomTemplate").should("exist"); | ||
cy.percySnapshot("Alert Custom Template screen"); | ||
}); | ||
}); | ||
|
||
it('previews rendered template correctly', () => { | ||
it("previews rendered template correctly", () => { | ||
const options = { | ||
value: '123', | ||
op: '==', | ||
custom_subject: '{{ ALERT_CONDITION }}', | ||
custom_body: '{{ ALERT_THRESHOLD }}', | ||
value: "123", | ||
op: "==", | ||
custom_subject: "{{ ALERT_CONDITION }}", | ||
custom_body: "{{ ALERT_THRESHOLD }}", | ||
}; | ||
|
||
createQuery() | ||
.then(({ id: queryId }) => createAlert(queryId, options)) | ||
.then(({ id: alertId }) => { | ||
cy.visit(`/alerts/${alertId}/edit`); | ||
cy.get('.alert-template-preview').click(); | ||
cy.getByTestId('CustomSubject').should('have.value', options.op); | ||
cy.getByTestId('CustomBody').should('have.value', options.value); | ||
cy.get(".alert-template-preview").click(); | ||
cy.getByTestId("CustomSubject").should("have.value", options.op); | ||
cy.getByTestId("CustomBody").should("have.value", options.value); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.