Skip to content

Commit

Permalink
test the abscence of error box
Browse files Browse the repository at this point in the history
  • Loading branch information
blemoineovh committed Nov 15, 2023
1 parent 77d7d8d commit 8506033
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
13 changes: 7 additions & 6 deletions front/src/applications/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,13 @@ const Editor: FC = () => {
return buttons;
})}
</div>

{mapRef.current && editorState.editorLayers.has('errors') && editorState.issues.total && (
<div className="error-box">
<InfraErrorMapControl mapRef={mapRef.current} switchTool={switchTool} />
</div>
)}
{mapRef.current &&
editorState.editorLayers.has('errors') &&
editorState.issues.total && (
<div className="error-box">
<InfraErrorMapControl mapRef={mapRef.current} switchTool={switchTool} />
</div>
)}
</div>
<div className="messages-bar border-left">
<div className="px-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import InputGroupSNCF, { InputGroupSNCFValue } from 'common/BootstrapSNCF/InputGroupSNCF';
import OptionsSNCF from 'common/BootstrapSNCF/OptionsSNCF';
import { onlyDigit } from 'utils/strings';
import { unitsList, unitsNames } from './consts';
import getAllowanceValue from './helpers';
import { AllowanceValueForm, StandardAllowanceForm } from './types';
import { onlyDigit } from 'utils/strings';

type Props = {
distribution: string;
Expand Down
8 changes: 8 additions & 0 deletions front/tests/005-operational-studies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import { ProjectPage } from './pages/project-page-model';
import { StudyPage } from './pages/study-page-model';

test.describe('Testing if all mandatory elements simulation configuration are loaded in operationnal studies app', () => {
test('Testing there is no error', async ({ page }) => {
const playwrightHomePage = new PlaywrightHomePage(page);
await playwrightHomePage.goToEditorPage();

await expect(
playwrightHomePage.getErrorBox
).not.toBeVisible();
})
test('Testing pathfinding with rollingstock an composition code', async ({ page }) => {
test.setTimeout(90000); // 1min30
const playwrightHomePage = new PlaywrightHomePage(page);
Expand Down
3 changes: 3 additions & 0 deletions front/tests/pages/home-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class PlaywrightHomePage {

readonly getViteOverlay: Locator;

readonly getErrorBox: Locator;

constructor(page: Page) {
this.page = page;
// Initialize locators using roles and text content
Expand All @@ -45,6 +47,7 @@ export class PlaywrightHomePage {
this.getBody = page.locator('body');
this.translation = home;
this.getViteOverlay = page.locator('vite-plugin-checker-error-overlay');
this.getErrorBox = page.locator('.error-box');
}

// Completly remove VITE button & sign
Expand Down

0 comments on commit 8506033

Please sign in to comment.