Skip to content

Commit

Permalink
[FM] Automated formating frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 8, 2024
1 parent d03a83b commit 8d8b0ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions frontend/cypress/support/objective-helper.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
export function getObjectiveByNameAndState(objectiveName: string, state: string) {
return getObjectivesByNameAndState(objectiveName, state).first().should('exist');
return getObjectivesByNameAndState(objectiveName, state).first().should('exist');
}

export function selectFromThreeDotMenu(optionName: string) {
cy.contains(optionName).should('exist');
cy.get('.objective-three-dot-menu').contains(optionName).should('have.class', 'objective-menu-option').click();
cy.contains(optionName).should('exist');
cy.get('.objective-three-dot-menu').contains(optionName).should('have.class', 'objective-menu-option').click();
}

function getObjectivesByNameAndState(objectiveName: string, state: string) {
return getObjectiveColumns()
.filter((index, element) => filterByObjectiveName(element, objectiveName))
.filter((index, element) => filterByState(element, state));
return getObjectiveColumns()
.filter((index, element) => filterByObjectiveName(element, objectiveName))
.filter((index, element) => filterByState(element, state));
}

const filterByState = (element: HTMLElement, icon: string) => {
return Cypress.$(element).find(`[src='assets/icons/${icon}-icon.svg']`).length > 0;
return Cypress.$(element).find(`[src='assets/icons/${icon}-icon.svg']`).length > 0;
};
const filterByObjectiveName = (element: HTMLElement, objectiveName: string) => {
return Cypress.$(element).find(`:contains("${objectiveName}")`).length > 0;
return Cypress.$(element).find(`:contains("${objectiveName}")`).length > 0;
};

function getObjectiveColumns() {
return cy.get('.objective');
}
return cy.get('.objective');
}

0 comments on commit 8d8b0ff

Please sign in to comment.