Skip to content

Commit

Permalink
fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 15, 2024
1 parent ff9e9c1 commit 8ef4529
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .run/OkrApplication-E2E.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OkrApplication-E2E" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<option name="ACTIVE_PROFILES" value="integration-test" />
<option name="ALTERNATIVE_JRE_PATH" value="azul-17" />
<option name="ALTERNATIVE_JRE_PATH" value="corretto-21" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<module name="backend" />
<option name="SPRING_BOOT_MAIN_CLASS" value="ch.puzzle.okr.OkrApplication" />
Expand Down
24 changes: 3 additions & 21 deletions frontend/cypress/e2e/overview.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,9 @@ describe('OKR Overview', () => {
cy.loginAsUser(users.gl);
});

it.only('should have the current quarter with label Aktuell', () => {
cy.getByTestId('quarterFilter')
.contains('Aktuell')
.invoke('text')
.then((text) => {
//Checks if the current quarter is displayed with the label Aktuell not sure if this is needed
const currentDate = new Date();
const currentMonth = currentDate.getMonth();
let quarter = Math.ceil((currentMonth + 1) / 3 + 1);

if (quarter > 4) {
quarter -= 4;
}

const businessYearStart = quarter > 2 ? currentDate.getFullYear() - 2001 : currentDate.getFullYear() - 2000;
const businessYearEnd = businessYearStart + 1;

const expectedText = `GJ ${businessYearStart}/${businessYearEnd}-Q${quarter} Aktuell`;

expect(text).to.contain(expectedText);
});
it('should have the current quarter with label Aktuell', () => {
cy.visit('/?quarter=2');
cy.getByTestId('quarterFilter').contains('Aktuell');
});

it('Check order of teams', () => {
Expand Down

0 comments on commit 8ef4529

Please sign in to comment.