Skip to content

Commit

Permalink
changed headline matching date to regex to prevent test from breaking…
Browse files Browse the repository at this point in the history
… on new year
  • Loading branch information
felix.ruf committed Feb 20, 2025
1 parent f3b70ee commit 4d0eb35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/e2e/cypress/e2e/Menu.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Test Weeks View', () => {
cy.wait(['@getDishesCount', '@getCategories', '@getDishes', '@getEvents', '@getLockdates']);

cy.url().should('include', '/menu');
cy.get('h2').should('contain', 'Woche bearbeiten #28 (08.07. - 12.07.)');
cy.get('h2').invoke('text').should('match', /Woche bearbeiten #\d{1,2} \(\d{1,2}.\d{1,2}. - \d{1,2}.\d{1,2}.\)/);

// change input
cy.get('input')
Expand All @@ -41,7 +41,7 @@ describe('Test Weeks View', () => {
.parent().parent()
.find('li').contains('Lammhaxxe in Biersoße mit Klößen')
.click();
cy.get('h2').should('contain', 'Woche bearbeiten #28 (08.07. - 12.07.)').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28').click();

// change event
cy.get('input')
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('Test Weeks View', () => {
.clear()
.type('17');
cy.get('span').contains('Limit').parent().find('svg').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28 (08.07. - 12.07.)').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28').click();

// change lock date
cy.get('input')
Expand All @@ -112,7 +112,7 @@ describe('Test Weeks View', () => {
.contains(new RegExp(/^7$/))
.click()
cy.get('span').contains('Sperren').parent().find('svg').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28 (08.07. - 12.07.)').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28').click();

// change input
cy.get('input')
Expand All @@ -130,7 +130,7 @@ describe('Test Weeks View', () => {
.click();
cy.get('button').contains('Variation').click();
cy.get('span').contains('Innards DE #v1').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28 (08.07. - 12.07.)').click();
cy.get('h2').should('contain', 'Woche bearbeiten #28').click();

cy.contains('input', 'Speichern').click();

Expand Down

0 comments on commit 4d0eb35

Please sign in to comment.