Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: fix missing await statements for asynchronous calls #10242

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions front/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
"rules": {
"@typescript-eslint/no-explicit-any": ["error", { "fixToUnknown": true }]
}
},
{
"files": ["tests/**/*.ts", "tests/**/*.tsx"],
"rules": {
"@typescript-eslint/no-floating-promises": "error"
emersion marked this conversation as resolved.
Show resolved Hide resolved
}
}
]
}
2 changes: 1 addition & 1 deletion front/tests/004-scenario-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('Validate the Scenario creation workflow', () => {
});

test.afterAll('Delete the electrical profile', async () => {
deleteApiRequest(`/api/electrical_profile_set/${electricalProfileSet.id}/`);
await deleteApiRequest(`/api/electrical_profile_set/${electricalProfileSet.id}/`);
});

/** *************** Test 1 **************** */
Expand Down
2 changes: 1 addition & 1 deletion front/tests/pages/op-simulation-settings-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OperationalStudiesSimulationSettingsPage {
// Deactivate electrical profiles switch
async deactivateElectricalProfile() {
await this.electricalProfilesSwitch.setChecked(false, { force: true });
expect(this.electricalProfilesSwitch).not.toBeChecked();
await expect(this.electricalProfilesSwitch).not.toBeChecked();
}

async activateLinearMargin() {
Expand Down
2 changes: 1 addition & 1 deletion front/tests/pages/op-timetable-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class OperationalStudiesTimetablePage extends CommonPage {
// Verify that the imported train number is correct
async verifyTrainCount(trainCount: number): Promise<void> {
await this.page.waitForLoadState('networkidle');
expect(this.timetableTrains).toHaveCount(trainCount);
await expect(this.timetableTrains).toHaveCount(trainCount);
}

// Filter trains validity and verify their count
Expand Down
2 changes: 1 addition & 1 deletion front/tests/pages/operational-studies-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class OperationalStudiesPage extends CommonPage {
}

async checkTrainHasBeenAdded() {
this.checkLastToastTitle(trainAddedTranslation);
await this.checkLastToastTitle(trainAddedTranslation);
}

async returnSimulationResult() {
Expand Down
Loading