Skip to content

Commit

Permalink
front: editor: split tests in separated files
Browse files Browse the repository at this point in the history
and add line feeds in EOF
  • Loading branch information
blemoineovh committed Dec 12, 2023
1 parent 5f3df61 commit 1d6c58a
Show file tree
Hide file tree
Showing 4 changed files with 1,836 additions and 1,900 deletions.
14 changes: 8 additions & 6 deletions front/src/applications/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,14 @@ const Editor: FC = () => {
})}
</div>

{mapRef.current && editorState.editorLayers.has('errors') && (
<div className="error-box">
<InfraErrorMapControl mapRef={mapRef.current} switchTool={switchTool} />
<InfraErrorCorrector />
</div>
)}
{mapRef.current &&
editorState.editorLayers.has('errors') &&
editorState.issues.total && (
<div className="error-box">
<InfraErrorMapControl mapRef={mapRef.current} switchTool={switchTool} />
<InfraErrorCorrector />
</div>
)}
</div>
<div className="messages-bar border-left">
<div className="px-1">
Expand Down
14 changes: 14 additions & 0 deletions front/tests/010-editor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import {expect, test} from '@playwright/test';
import {PlaywrightEditorPage} from "./pages/editor-page-model";

test.describe('Testing the Editor app', () => {
test('Testing there is no error by default in the Editor', async ({page}) => {
const playwrightEditorPage = new PlaywrightEditorPage(page);
await playwrightEditorPage.goToEditorPage()

await expect(
playwrightEditorPage.getErrorBox
).not.toBeVisible();
})
})
20 changes: 20 additions & 0 deletions front/tests/pages/editor-page-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


/* eslint-disable import/prefer-default-export */
import { expect, Locator, Page } from '@playwright/test';

export class PlaywrightEditorPage {
// The current page object
readonly page: Page;
readonly getErrorBox: Locator;

constructor(page: Page) {
this.page = page;
this.getErrorBox = page.locator('.error-box');
}
// Navigate to the Home page
async goToEditorPage() {
await this.page.goto('/editor');
}

}
Loading

0 comments on commit 1d6c58a

Please sign in to comment.