Skip to content

Commit

Permalink
Add tests to ensure fix for buggy confirm dialog works
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Nov 15, 2024
1 parent d88be25 commit 2c882eb
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion frontend/cypress/e2e/objective.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,35 @@ describe('OKR Objective e2e tests', () => {
op.getObjectiveByNameAndState('This objective will be reopened after', 'ongoing').should('exist');
});

it('Ongoing objective back to draft state', () => {
it(`Cancel Reopen Successful Objective`, () => {
op.addObjective().fillObjectiveTitle('The reopening of this objective will be canceled').submit();

op.getObjectiveByNameAndState('The reopening of this objective will be canceled', 'ongoing')
.findByTestId('three-dot-menu')
.click();

op.selectFromThreeDotMenu('Objective abschliessen');

cy.getByTestId('successful').click();
cy.getByTestId('submit').click();

cy.wait(500);

op.getObjectiveByNameAndState('he reopening of this objective will be canceled', 'successful')
.findByTestId('three-dot-menu')
.click();

op.selectFromThreeDotMenu('Objective wiedereröffnen');

ConfirmDialog.do()
.checkTitle('Objective wiedereröffnen')
.checkDescription('Soll dieses Objective wiedereröffnet werden?')
.cancel();

op.getObjectiveByNameAndState('The reopening of this objective will be canceled', 'successful').should('exist');
});

it('Cancel Ongoing objective back to draft state', () => {
onlyOn('chrome');
op.addObjective().fillObjectiveTitle('This objective will be returned to draft state').submit();

Expand All @@ -113,6 +141,25 @@ describe('OKR Objective e2e tests', () => {
op.getObjectiveByNameAndState('This objective will be returned to draft state', 'draft').should('exist');
});

it.only('Ongoing objective back to draft state', () => {
onlyOn('chrome');
op.addObjective().fillObjectiveTitle('Putting this objective back to draft state will be canceled').submit();

op.getObjectiveByNameAndState('Putting this objective back to draft state will be canceled', 'ongoing')
.findByTestId('three-dot-menu')
.click();
op.selectFromThreeDotMenu('Objective als Draft speichern');

ConfirmDialog.do()
.checkTitle('Objective als Draft speichern')
.checkDescription('Soll dieses Objective als Draft gespeichert werden?')
.cancel();

op.getObjectiveByNameAndState('Putting this objective back to draft state will be canceled', 'ongoing').should(
'exist',
);
});

it(`Search for Objective`, () => {
op.addObjective().fillObjectiveTitle('Search after this objective').submit();

Expand Down

0 comments on commit 2c882eb

Please sign in to comment.