Skip to content

Commit

Permalink
test: update e2e test script for new component
Browse files Browse the repository at this point in the history
  • Loading branch information
rosejbon committed Sep 19, 2023
1 parent 28b23c6 commit b6e1c71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions cypress/e2e/desktop/add.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Adding new toilets to the platform', () => {
cy.visit('/loos/add');
cy.findByText('Save toilet').click();

cy.get('[data-icon="asterisk"]').should('exist');
cy.get('[data-test="asterisk"]').should('exist');
cy.findByText('Please specify a toilet name').should('exist');

const toiletName = faker.word.adjective() + ' ' + faker.word.noun();
Expand All @@ -101,12 +101,12 @@ describe('Adding new toilets to the platform', () => {
cy.get('[name=monday-is-open').click();

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 2);
cy.get('[data-test="asterisk"]').should('have.length', 2);

cy.get('[name=monday-opens]').type('08:00');

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 1);
cy.get('[data-test="asterisk"]').should('have.length', 1);

cy.get('[name=monday-closes]').type('19:00');
cy.findByText('Save toilet').click();
Expand All @@ -128,12 +128,12 @@ describe('Adding new toilets to the platform', () => {
cy.get('[name=monday-is-open').click();

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 2);
cy.get('[data-test="asterisk"]').should('have.length', 2);

cy.get('[name=monday-opens]').type('08:00');

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 1);
cy.get('[data-test="asterisk"]').should('have.length', 1);

cy.get('[name=monday-closes]').type('19:00');

Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/mobile/add.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Adding new toilets to the platform', () => {
cy.visit('/loos/add');
cy.findByText('Save toilet').click();

cy.get('[data-icon="asterisk"]').should('exist');
cy.get('[data-test="asterisk"]').should('exist');
cy.findByText('Please specify a toilet name').should('exist');

const toiletName = faker.word.adjective() + ' ' + faker.word.noun();
Expand All @@ -101,12 +101,12 @@ describe('Adding new toilets to the platform', () => {
cy.get('[name=monday-is-open').click();

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 2);
cy.get('[data-test="asterisk"]').should('have.length', 2);

cy.get('[name=monday-opens]').type('08:00');

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 1);
cy.get('[data-test="asterisk"]').should('have.length', 1);

cy.get('[name=monday-closes]').type('19:00');
cy.findByText('Save toilet').click();
Expand All @@ -128,12 +128,12 @@ describe('Adding new toilets to the platform', () => {
cy.get('[name=monday-is-open').click();

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 2);
cy.get('[data-test="asterisk"]').should('have.length', 2);

cy.get('[name=monday-opens]').type('08:00');

cy.findByText('Save toilet').click();
cy.get('[data-icon="asterisk"]').should('have.length', 1);
cy.get('[data-test="asterisk"]').should('have.length', 1);

cy.get('[name=monday-closes]').type('19:00');

Expand Down

0 comments on commit b6e1c71

Please sign in to comment.