Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FM] Automated formating frontend
Browse files Browse the repository at this point in the history
actions-user committed Dec 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent beee7bf commit d29ba72
Showing 3 changed files with 51 additions and 12 deletions.
54 changes: 45 additions & 9 deletions frontend/cypress/e2e/duplicate-objective.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as users from '../fixtures/users.json';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';
import ObjectiveDialog from "../support/helper/dom-helper/dialogs/objectiveDialog";
import ObjectiveDialog from '../support/helper/dom-helper/dialogs/objectiveDialog';

let overviewPage = new CyOverviewPage();

@@ -13,26 +13,62 @@ beforeEach(() => {
describe('Functionality of duplicating objectives and their belonging keyresults', () => {
it('Should be able to duplicate a objective into this quarter, including all keyresults', () => {
const duplicatedTitle = 'This is a duplicated objective with all keyResults';
overviewPage.getObjectiveByName('Build a company culture that kills the competition.').findByTestId('three-dot-menu').click();
overviewPage
.getObjectiveByName('Build a company culture that kills the competition.')
.findByTestId('three-dot-menu')
.click();
overviewPage.selectFromThreeDotMenu('Objective duplizieren');
ObjectiveDialog.do().fillObjectiveTitle(duplicatedTitle).submit();

cy.contains('This is a default duplicated objective');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with all keyResults', 'New structure that rewards funny guys and innovation before the end of Q1.').should('exist');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with all keyResults', 'Monthly town halls between our people and leadership teams over the next four months.').should('exist');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with all keyResults', 'High employee satisfaction scores (80%+) throughout the year.').should('exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with all keyResults',
'New structure that rewards funny guys and innovation before the end of Q1.',
)
.should('exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with all keyResults',
'Monthly town halls between our people and leadership teams over the next four months.',
)
.should('exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with all keyResults',
'High employee satisfaction scores (80%+) throughout the year.',
)
.should('exist');
});

it('Should be able to duplicate a objective into this quarter, only including one keyresult', () => {
const duplicatedTitle = 'This is a duplicated objective with one keyResult';
overviewPage.getObjectiveByName('Build a company culture that kills the competition.').findByTestId('three-dot-menu').click();
overviewPage
.getObjectiveByName('Build a company culture that kills the competition.')
.findByTestId('three-dot-menu')
.click();
overviewPage.selectFromThreeDotMenu('Objective duplizieren');
ObjectiveDialog.do().fillObjectiveTitle(duplicatedTitle).submit();

cy.contains('This is a duplicated objective with one keyResult');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with one keyResult', 'New structure that rewards funny guys and innovation before the end of Q1.').should('exist');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with one keyResult', 'Monthly town halls between our people and leadership teams over the next four months.').should('not.exist');
overviewPage.getKeyresultOfObjective('This is a duplicated objective with one keyResult', 'High employee satisfaction scores (80%+) throughout the year.').should('not.exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with one keyResult',
'New structure that rewards funny guys and innovation before the end of Q1.',
)
.should('exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with one keyResult',
'Monthly town halls between our people and leadership teams over the next four months.',
)
.should('not.exist');
overviewPage
.getKeyresultOfObjective(
'This is a duplicated objective with one keyResult',
'High employee satisfaction scores (80%+) throughout the year.',
)
.should('not.exist');
});
});

Original file line number Diff line number Diff line change
@@ -93,7 +93,11 @@ export default class CyOverviewPage extends Page {
}

getKeyresultOfObjective(objectiveName: string, keyResultName: string) {
return this.getObjectiveByName(objectiveName).last().find('.key-result').filter(filterByKeyResultName(keyResultName)).last();
return this.getObjectiveByName(objectiveName)
.last()
.find('.key-result')
.filter(filterByKeyResultName(keyResultName))
.last();
}

getObjectivesByName(objectiveName: string) {
3 changes: 1 addition & 2 deletions frontend/src/style/styles.scss
Original file line number Diff line number Diff line change
@@ -379,15 +379,14 @@ table.okr-table {

.keyResult-checkbox {
.mdc-label {
background: #F5F5F5;
background: #f5f5f5;
padding: 4px 4px 4px 4px;
}
.mdc-form-field {
width: 100%;
}
}


@import "custom_bootstrap";

.spinner-container {

0 comments on commit d29ba72

Please sign in to comment.