Skip to content

Commit

Permalink
#958: fix Cypress Tests für Anpassung der Quartale
Browse files Browse the repository at this point in the history
  • Loading branch information
clean-coder committed Jul 12, 2024
1 parent 2674daf commit 3c849ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
27 changes: 13 additions & 14 deletions frontend/cypress/e2e/objective-backlog.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('OKR Objective Backlog e2e tests', () => {

cy.get('Objective in quarter backlog').should('not.exist');

cy.visit('/?quarter=199');
cy.visit('/?quarter=999');

cy.contains('Objective in quarter backlog');
});
Expand All @@ -41,7 +41,7 @@ describe('OKR Objective Backlog e2e tests', () => {

cy.get('This goes now to backlog').should('not.exist');

cy.visit('/?quarter=199');
cy.visit('/?quarter=999');

cy.contains('This goes now to backlog');
});
Expand All @@ -60,12 +60,12 @@ describe('OKR Objective Backlog e2e tests', () => {
.contains('Objective bearbeiten')
.click();

cy.get('select#quarter').should('contain', 'GJ 23/24-Q1');
cy.get('select#quarter').should('contain', 'GJ ForTests');
cy.get('select#quarter').should('not.contain', 'Backlog');
});

it(`Can release Objective to another quarter from backlog`, () => {
cy.visit('/?quarter=199');
cy.visit('/?quarter=999');
cy.getByTestId('add-objective').first().click();
cy.getByTestId('title').first().clear().type('We can not release this');
cy.getByTestId('safe').should('not.exist');
Expand All @@ -89,21 +89,21 @@ describe('OKR Objective Backlog e2e tests', () => {
cy.getByTestId('title').first().clear().type('This is our first released objective');

cy.get('select#quarter').should('not.contain', 'Backlog');
cy.get('select#quarter').select('GJ 22/23-Q4');
cy.get('select#quarter').select('GJ ForTests');

cy.contains('Als Draft speichern').should('not.exist');
cy.contains('Speichern');
cy.getByTestId('safe').click();

cy.contains('This is our first released objective').should('not.exist');

cy.visit('/?quarter=1');
cy.visit('/?quarter=99');

cy.contains('This is our first released objective');
});

it(`Can edit Objective title in backlog`, () => {
cy.visit('/?quarter=199');
cy.visit('/?quarter=999');
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('This is possible for edit', 'safe-draft', undefined, '', false);

Expand All @@ -125,7 +125,7 @@ describe('OKR Objective Backlog e2e tests', () => {
});

it(`Can edit Objective in backlog and change quarter`, () => {
cy.visit('/?quarter=199');
cy.visit('/?quarter=999');
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('This goes to other quarter later', 'safe-draft', undefined, '', false);

Expand All @@ -139,15 +139,15 @@ describe('OKR Objective Backlog e2e tests', () => {
.contains('Objective bearbeiten')
.click();

cy.get('select#quarter').select('GJ 22/23-Q4');
cy.get('select#quarter').select('GJ ForTests');
cy.getByTestId('safe').first().click();

cy.visit('/?quarter=1');
cy.visit('/?quarter=99');
cy.contains('This goes to other quarter later');
});

it(`Can duplicate from backlog`, () => {
cy.visit('/?quarter=199');
cy.visit('/?quarter=99');
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('Ready for duplicate', 'safe-draft', undefined, '', false);

Expand Down Expand Up @@ -176,10 +176,9 @@ describe('OKR Objective Backlog e2e tests', () => {
.contains('Objective duplizieren')
.click();

cy.fillOutObjective('New duplication for other quarter', 'safe', 'GJ 22/23-Q4', '', false);
cy.fillOutObjective('New duplication for other quarter', 'safe', 'GJ ForTests', '', false);
cy.get('New duplication for other quarter').should('not.exist');

cy.visit('/?quarter=1');
cy.contains('New duplication for other quarter');
});

Expand All @@ -200,7 +199,7 @@ describe('OKR Objective Backlog e2e tests', () => {
cy.get('select#quarter').select('Backlog');
cy.getByTestId('safe').first().click();

cy.visit('/?quarter=199');
cy.visit('/?quarter=999');
cy.contains('Possible to duplicate into backlog');
});
});
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/objective.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ describe('OKR Objective e2e tests', () => {
.contains('Objective bearbeiten')
.click();

cy.fillOutObjective('Move to another quarter on edit', 'safe', 'GJ 22/23-Q4', '', false);
cy.fillOutObjective('Move to another quarter on edit', 'safe', '3', '', false);

cy.get('Move to another quarter on edit').should('not.exist');

cy.visit('/?quarter=1');
cy.visit('/?quarter=3');

cy.contains('Move to another quarter on edit');
});
Expand Down

0 comments on commit 3c849ba

Please sign in to comment.