Skip to content

Commit

Permalink
run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Dec 20, 2024
1 parent 288c33b commit 8d67841
Show file tree
Hide file tree
Showing 143 changed files with 744 additions and 744 deletions.
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/check-in.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ describe('OKR Check-in e2e tests', () => {
});
});

function getCurrentDate () {
function getCurrentDate() {
const today = new Date();
const yyyy = today.getFullYear();
const mm = today.getMonth() + 1; // Months start at 0!
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/scoring.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('Scoring component e2e tests', () => {
});
});

function setupMetricKR (
function setupMetricKR(
name: string, baseline: number, stretchgoal: number, value: number
) {
CyOverviewPage.do()
Expand Down
6 changes: 3 additions & 3 deletions frontend/cypress/e2e/tab.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ describe('Tab workflow tests', () => {
.focus();
});

function focusedShouldHaveTestId (testId: string) {
function focusedShouldHaveTestId(testId: string) {
cy.focused()
.should('have.attr', 'data-testId', testId);
}

function tabAndCheck (testId: string, text?: string) {
function tabAndCheck(testId: string, text?: string) {
cy.tabForwardUntil(`[data-testId="${testId}"]`);
focusedShouldHaveTestId(testId);
if (text) {
Expand Down Expand Up @@ -364,7 +364,7 @@ describe('Tab workflow tests', () => {
});
});

function tabToThreeDotMenuOption (name: string) {
function tabToThreeDotMenuOption(name: string) {
cy.pressUntilContains(name, 'ArrowDown');
cy.realPress('Enter');
}
12 changes: 6 additions & 6 deletions frontend/cypress/e2e/teammanagement.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Team management tests', () => {
checkTeamsSelected();
});

function checkTeamsSelected () {
function checkTeamsSelected() {
FilterHelper.do()
.optionShouldBeSelected('LoremIpsum')
.optionShouldBeSelected('/BBT');
Expand Down Expand Up @@ -543,12 +543,12 @@ describe('Team management tests', () => {
});
});

function closeOverlay () {
function closeOverlay() {
cy.get('.cdk-overlay-backdrop')
.click(-50, -50, { force: true });
}

function checkRolesForEsha () {
function checkRolesForEsha() {
cy.get('app-member-detail tbody tr')
.eq(0)
.should('contain', '/BBT')
Expand All @@ -559,7 +559,7 @@ function checkRolesForEsha () {
.and('contain', 'Team-Member');
}

function editTeamNameAndTest (teamName: string) {
function editTeamNameAndTest(teamName: string) {
cy.intercept('PUT', '**/teams/*')
.as('saveTeam');
cy.getByTestId('editTeamButton')
Expand All @@ -577,7 +577,7 @@ function editTeamNameAndTest (teamName: string) {
cy.contains(teamName);
}

function navigateToUser (userName: string) {
function navigateToUser(userName: string) {
cy.intercept('GET', '**/users/*')
.as('getUser');
cy.get('td')
Expand All @@ -586,7 +586,7 @@ function navigateToUser (userName: string) {
cy.wait('@getUser');
}

function fillOutNewUser (firstname: string, lastname: string, email: string) {
function fillOutNewUser(firstname: string, lastname: string, email: string) {
cy.realType(firstname);
cy.tabForward();
cy.realType(lastname);
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Cypress.Commands.add('validateScoring', (isOverview: boolean, percentage: number
validateScoring(isOverview, percentage);
});

function loginWithCredentials (username: string, password: string) {
function loginWithCredentials(username: string, password: string) {
cy.visit('/');
cy.intercept('GET', '**/users/current')
.as('getCurrentUser');
Expand Down
16 changes: 8 additions & 8 deletions frontend/cypress/support/helper/dom-helper/angularSearchBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,44 @@ import { PageObjectMapperBase } from './pageObjectMapperBase';
export default class AngularSearchBox extends PageObjectMapperBase {
selector: string;

constructor (selector: string) {
constructor(selector: string) {
super();
this.selector = selector;
this.validatePage();
}

fill (value: string) {
fill(value: string) {
const input = cy.get('input')
.first();
input.clear();
input.type(value);
return this;
}

shouldHaveOption (option: string) {
shouldHaveOption(option: string) {
cy.contains('.mat-mdc-autocomplete-panel mat-option', option);
return this;
}

shouldHaveLabel (label: string) {
shouldHaveLabel(label: string) {
cy.contains('.mat-mdc-autocomplete-panel .mat-mdc-optgroup-label', label);
return this;
}

selectOption (option: string) {
selectOption(option: string) {
cy.contains('.mat-mdc-autocomplete-panel mat-option', option)
.click();
}

getPage () {
getPage() {
return cy.get(this.selector);
}

static from (selector: string): AngularSearchBox {
static from(selector: string): AngularSearchBox {
return new this(selector);
}

validatePage (): void {
validatePage(): void {
this.getPage()
.should('exist');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import Dialog from './dialog';
import Chainable = Cypress.Chainable;

export default class CheckInDialog extends Dialog {
fillCheckInCommentary (commentary: string) {
fillCheckInCommentary(commentary: string) {
this.fillInputByTestId('changeInfo', commentary);
return this;
}

fillMetricCheckInValue (value: string) {
fillMetricCheckInValue(value: string) {
this.fillInputByTestId('check-in-metric-value', value);
return this;
}

selectOrdinalCheckInZone (zone: 'fail' | 'commit' | 'target' | 'stretch') {
selectOrdinalCheckInZone(zone: 'fail' | 'commit' | 'target' | 'stretch') {
switch (zone) {
case 'fail':
cy.getByTestId('fail-radio')
Expand All @@ -34,12 +34,12 @@ export default class CheckInDialog extends Dialog {
return this;
}

fillCheckInInitiatives (value: string) {
fillCheckInInitiatives(value: string) {
this.fillInputByTestId('initiatives', value);
return this;
}

setCheckInConfidence (confidence: number) {
setCheckInConfidence(confidence: number) {
cy.getByTestId('confidence-slider')
.find('input')
.focus();
Expand All @@ -52,7 +52,7 @@ export default class CheckInDialog extends Dialog {
return this;
}

checkForDialogTextMetric () {
checkForDialogTextMetric() {
cy.contains('Very important keyresult');
cy.contains('Check-in erfassen');
cy.contains('Key Result');
Expand All @@ -62,7 +62,7 @@ export default class CheckInDialog extends Dialog {
return this;
}

checkForDialogTextOrdinal () {
checkForDialogTextOrdinal() {
cy.contains('A new ordinal keyresult for our company');
cy.contains('Check-in erfassen');
cy.contains('Key Result');
Expand All @@ -79,12 +79,12 @@ export default class CheckInDialog extends Dialog {
return this;
}

override submit () {
override submit() {
cy.getByTestId('submit-check-in')
.click();
}

getPage (): Chainable {
getPage(): Chainable {
return cy.get('app-check-in-form');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import CheckInDialog from './checkInDialog';
import Chainable = Cypress.Chainable;

export default class CheckInHistoryDialog extends Dialog {
override submit () {
override submit() {
throw new Error('This dialog doesnt have a submit button');
}

override cancel () {
override cancel() {
cy.getByTestId('closeButton')
.click();
}

editLatestCheckIn () {
editLatestCheckIn() {
cy.getByTestId('edit-check-in')
.first()
.click();
return new CheckInDialog();
}

getPage (): Chainable {
getPage(): Chainable {
return cy.get('app-check-in-history-dialog');
}

checkForAttribute (title: string, value: string) {
checkForAttribute(title: string, value: string) {
cy.get('mat-dialog-container')
.contains(value)
.parent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ import Dialog from './dialog';
import Chainable = Cypress.Chainable;

export default class ConfirmDialog extends Dialog {
checkTitle (title: string) {
checkTitle(title: string) {
this.getPage()
.contains(title)
.should('exist');
return this;
}

checkDescription (title: string) {
checkDescription(title: string) {
this.getPage()
.contains(title)
.should('exist');
return this;
}

override submit () {
override submit() {
cy.getByTestId('confirm-yes')
.click();
}

override cancel () {
override cancel() {
cy.getByTestId('confirm-no')
.click();
}

getPage (): Chainable {
getPage(): Chainable {
return cy.get('app-confirm-dialog');
}
}
16 changes: 8 additions & 8 deletions frontend/cypress/support/helper/dom-helper/dialogs/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ import { PageObjectMapperBase } from '../pageObjectMapperBase';
import Chainable = Cypress.Chainable;

export default abstract class Dialog extends PageObjectMapperBase {
constructor () {
constructor() {
super();
this.validatePage();
}

override validatePage () {
override validatePage() {
this.getPage()
.should('exist');
}

submit () {
submit() {
cy.getByTestId('save')
.click();
}

cancel () {
cancel() {
cy.getByTestId('cancel')
.click();
}

close () {
close() {
cy.getByTestId('close-dialog')
.click();
}

protected fillInputByTestId (testId: string, value: string) {
protected fillInputByTestId(testId: string, value: string) {
const elem = cy.getByTestId(testId);
this.fillInput(elem, value);
}

protected fillInput (elem: Cypress.Chainable<JQuery<HTMLElement>>, value: string) {
protected fillInput(elem: Cypress.Chainable<JQuery<HTMLElement>>, value: string) {
elem.clear();
elem.type(value);
}

abstract getPage (): Chainable;
abstract getPage(): Chainable;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import Chainable = Cypress.Chainable;
export default class InviteMembersDialog extends Dialog {
private readonly firstnames: string[] = [];

override validatePage () {
override validatePage() {
super.validatePage();
this.getPage()
.contains('Members registrieren')
.should('exist');
}

enterUser (firstName: string, lastName: string, email: string) {
enterUser(firstName: string, lastName: string, email: string) {
firstName = uniqueSuffix(firstName);
email = uniqueSuffix(email);
this.firstnames.push(firstName);
Expand All @@ -28,23 +28,23 @@ export default class InviteMembersDialog extends Dialog {
return this;
}

addAnotherUser () {
addAnotherUser() {
cy.contains('Weiterer Member hinzufügen')
.click();
return this;
}

getFirstNames () {
getFirstNames() {
return this.firstnames;
}

override submit () {
override submit() {
cy.getByTestId('invite')
.click();
return this.firstnames;
}

getPage (): Chainable {
getPage(): Chainable {
return cy.get('app-invite-user-dialog');
}
}
Loading

0 comments on commit 8d67841

Please sign in to comment.