Skip to content

Commit

Permalink
fix objective e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 5, 2024
1 parent 560f196 commit 3d98dad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions frontend/cypress/e2e/objective.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('OKR Objective e2e tests', () => {
.should('have.attr', 'src', `assets/icons/not-successful-icon.svg`);
});

it(`Reopen Successful Objective`, () => {
it.only(`Reopen Successful Objective`, () => {
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('This objective will be reopened after', 'safe', undefined, '', false);

Expand Down Expand Up @@ -129,14 +129,18 @@ describe('OKR Objective e2e tests', () => {
.contains('Objective wiedereröffnen')
.click();

cy.contains('Objective wiedereröffnen');
cy.contains('Soll dieses Objective wiedereröffnet werden?');
cy.getByTestId('confirmYes').click();

cy.getByTestId('objective')
.filter(':contains("This objective will be reopened after")')
.last()
.getByTestId('objective-state')
.should('have.attr', 'src', `assets/icons/ongoing-icon.svg`);
});

it('Ongoing objective back to draft state', () => {
it.only('Ongoing objective back to draft state', () => {
onlyOn('chrome');
cy.getByTestId('add-objective').first().click();
cy.fillOutObjective('This objective will be returned to draft state', 'safe', undefined, '', false);
Expand All @@ -154,7 +158,7 @@ describe('OKR Objective e2e tests', () => {
.tabForward();
cy.contains('Objective als Draft speichern');
cy.contains('Soll dieses Objective als Draft gespeichert werden?');
cy.focused().click().wait(500);
cy.getByTestId('confirmYes').click();

cy.getByTestId('objective')
.filter(':contains("This objective will be returned to draft state")')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ObjectiveMenuActions {
}

objectiveBackToDraft(): ObjectiveMenuEntry {
const action: ObjectiveMenuAction = () => this.dialogService.openConfirmDialog('CONFIRMATION.DRAFT_CREATE');
const action: ObjectiveMenuAction = () => this.dialogService.openConfirmDialog('CONFIRMATION.TO_DRAFT');
const afterAction: ObjectiveMenuAfterAction = (obj: Objective, result: any) =>
this.afterActions.objectiveBackToDraft(obj);

Expand Down

0 comments on commit 3d98dad

Please sign in to comment.