Skip to content

Commit

Permalink
Fix e2e tests because of new quarter
Browse files Browse the repository at this point in the history
  • Loading branch information
lkleisa committed Apr 25, 2024
1 parent 2b5fdce commit 06324cd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions frontend/cypress/e2e/checkIn.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ describe('OKR Check-in e2e tests', () => {

it(`Should display confirm dialog when creating checkin on draft objective`, () => {
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('draft objective title', 'safe-draft', '3');
cy.visit('/?quarter=3');
cy.fillOutObjective('draft objective title', 'safe-draft', '1');
cy.visit('/?quarter=1');
cy.contains('draft objective title').first().parentsUntil('#objective-column').last().focus();

cy.tabForwardUntil('[data-testId="add-keyResult"]');
Expand Down Expand Up @@ -290,8 +290,8 @@ describe('OKR Check-in e2e tests', () => {

it(`Should not display last value div if last checkin is not present`, () => {
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('new objective', 'safe', '3');
cy.visit('/?quarter=3');
cy.fillOutObjective('new objective', 'safe', '1');
cy.visit('/?quarter=1');
cy.contains('new objective').first().parentsUntil('#objective-column').last().focus();

cy.tabForwardUntil('[data-testId="add-keyResult"]');
Expand Down
10 changes: 5 additions & 5 deletions frontend/cypress/e2e/crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ describe('CRUD operations', () => {
].forEach(([objectiveTitle, buttonTestId, icon]) => {
it(`Create objective, no keyresults`, () => {
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective(objectiveTitle, buttonTestId, '3');
cy.visit('/?quarter=3');
cy.fillOutObjective(objectiveTitle, buttonTestId, '1');
cy.visit('/?quarter=1');
const objective = cy.contains(objectiveTitle).first().parentsUntil('#objective-column').last();
objective.getByTestId('objective-state').should('have.attr', 'src', `assets/icons/${icon}`);
});
Expand All @@ -25,7 +25,7 @@ describe('CRUD operations', () => {
].forEach(([objectiveTitle, buttonTestId, icon]) => {
it(`Create objective, no keyresults`, () => {
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective(objectiveTitle, buttonTestId, '3', '', true);
cy.fillOutObjective(objectiveTitle, buttonTestId, '1', '', true);
cy.contains('Key Result erfassen');
});
});
Expand All @@ -42,8 +42,8 @@ describe('CRUD operations', () => {
it(`Create objective, cancel`, () => {
const objectiveTitle = 'this is a canceled objective';
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective(objectiveTitle, 'cancel', '3');
cy.visit('/?quarter=3');
cy.fillOutObjective(objectiveTitle, 'cancel', '1');
cy.visit('/?quarter=1');
cy.contains(objectiveTitle).should('not.exist');
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/duplicated-scoring.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ describe('e2e test for scoring adjustment on objective duplicate', () => {

cy.get('.objective').first().getByTestId('three-dot-menu').click();
cy.get('.mat-mdc-menu-content').contains('Objective duplizieren').click();
cy.fillOutObjective('A duplicated Objective for this tool', 'safe', '3');
cy.visit('/?quarter=3');
cy.fillOutObjective('A duplicated Objective for this tool', 'safe', '1');
cy.visit('/?quarter=1');

let scoringBlock1 = cy
.getByTestId('objective')
Expand Down
8 changes: 4 additions & 4 deletions frontend/cypress/e2e/objective-alignment.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('OKR Objective Alignment e2e tests', () => {
.contains('Objective bearbeiten')
.click();

cy.get('select#alignment').select('Bitte wählen');
cy.get('select#alignment').select('Kein Alignment');
cy.getByTestId('safe').click();

cy.getByTestId('objective')
Expand All @@ -123,7 +123,7 @@ describe('OKR Objective Alignment e2e tests', () => {
});

it(`Alignment Possibilites change when quarter change`, () => {
cy.visit('/?quarter=3');
cy.visit('/?quarter=1');

cy.getByTestId('add-objective').first().click();
cy.getByTestId('title').first().clear().type('We can link later on this');
Expand All @@ -145,12 +145,12 @@ describe('OKR Objective Alignment e2e tests', () => {
cy.get('select#alignment option:selected').should('not.contain.text', selectValue);
cy.getByTestId('cancel').click();

cy.visit('/?quarter=4');
cy.visit('/?quarter=2');

cy.getByTestId('add-objective').first().click();
cy.getByTestId('title').first().clear().type('Quarter change objective');

cy.get('select#quarter').select('GJ 22/23-Q3');
cy.get('select#quarter').select('GJ 22/23-Q4');
cy.getByTestId('title').first().clear().type('A new title');
cy.get('select#alignment').select(1);

Expand Down

0 comments on commit 06324cd

Please sign in to comment.