Skip to content

Commit 15c7d76

Browse files
committed
🚨(e2e) upgrade eslint to v9 with e2e app
We upgraded ESLint to version 9 in the e2e app, which includes several improvements and fixes. This change also involves updating the ESLint configuration files to the new format and ensuring compatibility with the latest ESLint features.
1 parent d167076 commit 15c7d76

16 files changed

+48
-43
lines changed

src/frontend/apps/e2e/.eslintrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/frontend/apps/e2e/__tests__/app-impress/auth.setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const saveStorageState = async (
1313
const page = await context.newPage();
1414

1515
try {
16+
// eslint-disable-next-line playwright/no-networkidle
1617
await page.goto('/', { waitUntil: 'networkidle' });
1718
await page.content();
1819
await expect(page.getByText('Docs').first()).toBeVisible();
@@ -45,11 +46,9 @@ const saveStorageState = async (
4546
};
4647

4748
async function globalSetup(config: FullConfig) {
48-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
4949
const chromeConfig = config.projects.find((p) => p.name === 'chromium')!;
5050
const firefoxConfig = config.projects.find((p) => p.name === 'firefox')!;
5151
const webkitConfig = config.projects.find((p) => p.name === 'webkit')!;
52-
/* eslint-enable @typescript-eslint/no-non-null-assertion */
5352

5453
await saveStorageState(chromeConfig);
5554
await saveStorageState(webkitConfig);

src/frontend/apps/e2e/__tests__/app-impress/config.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test.describe('Config', () => {
4848
await expect(image).toBeVisible();
4949

5050
// Wait for the media-check to be processed
51-
// eslint-disable-next-line playwright/no-wait-for-timeout
51+
5252
await page.waitForTimeout(1000);
5353

5454
// Check src of image

src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable playwright/no-conditional-expect */
12
import path from 'path';
23

34
import { chromium, expect, test } from '@playwright/test';
@@ -214,7 +215,6 @@ test.describe('Doc Editor', () => {
214215
});
215216

216217
test('it saves the doc when we quit pages', async ({ page, browserName }) => {
217-
// eslint-disable-next-line playwright/no-skipped-test
218218
test.skip(browserName === 'webkit', 'This test is very flaky with webkit');
219219

220220
// Check the first doc
@@ -277,7 +277,7 @@ test.describe('Doc Editor', () => {
277277
await expect(image).toBeVisible();
278278

279279
// Wait for the media-check to be processed
280-
// eslint-disable-next-line playwright/no-wait-for-timeout
280+
281281
await page.waitForTimeout(1000);
282282

283283
// Check src of image
@@ -390,8 +390,6 @@ test.describe('Doc Editor', () => {
390390
const editor = page.locator('.ProseMirror');
391391
await editor.getByText('Hello').selectText();
392392

393-
/* eslint-disable playwright/no-conditional-expect */
394-
/* eslint-disable playwright/no-conditional-in-test */
395393
if (!ai_transform && !ai_translate) {
396394
await expect(page.getByRole('button', { name: 'AI' })).toBeHidden();
397395
return;
@@ -418,8 +416,6 @@ test.describe('Doc Editor', () => {
418416
page.getByRole('menuitem', { name: 'Language' }),
419417
).toBeHidden();
420418
}
421-
/* eslint-enable playwright/no-conditional-expect */
422-
/* eslint-enable playwright/no-conditional-in-test */
423419
});
424420
});
425421

src/frontend/apps/e2e/__tests__/app-impress/doc-grid-dnd.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ test.describe('Doc grid dnd', () => {
3636
expect(draggableBoundingBox).toBeDefined();
3737
expect(dropZoneBoundingBox).toBeDefined();
3838

39-
// eslint-disable-next-line playwright/no-conditional-in-test
4039
if (!draggableBoundingBox || !dropZoneBoundingBox) {
41-
throw new Error('Impossible de déterminer la position des éléments');
40+
throw new Error('Unable to determine the position of the elements');
4241
}
4342

4443
await page.mouse.move(
@@ -86,9 +85,8 @@ test.describe('Doc grid dnd', () => {
8685

8786
const noDropAndNoDragBoundigBox = await noDropAndNoDrag.boundingBox();
8887

89-
// eslint-disable-next-line playwright/no-conditional-in-test
9088
if (!canDropAndDragBoundigBox || !noDropAndNoDragBoundigBox) {
91-
throw new Error('Impossible de déterminer la position des éléments');
89+
throw new Error('Unable to determine the position of the elements');
9290
}
9391

9492
await page.mouse.move(
@@ -137,9 +135,8 @@ test.describe('Doc grid dnd', () => {
137135

138136
const noDropAndNoDragBoundigBox = await noDropAndNoDrag.boundingBox();
139137

140-
// eslint-disable-next-line playwright/no-conditional-in-test
141138
if (!canDropAndDragBoundigBox || !noDropAndNoDragBoundigBox) {
142-
throw new Error('Impossible de déterminer la position des éléments');
139+
throw new Error('Unable to determine the position of the elements');
143140
}
144141

145142
await page.mouse.move(

src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ test.describe('Doc Header', () => {
281281
page,
282282
browserName,
283283
}) => {
284-
// eslint-disable-next-line playwright/no-skipped-test
285284
test.skip(
286285
browserName === 'webkit',
287286
'navigator.clipboard is not working with webkit and playwright',
@@ -316,7 +315,6 @@ test.describe('Doc Header', () => {
316315
});
317316

318317
test('It checks the copy as HTML button', async ({ page, browserName }) => {
319-
// eslint-disable-next-line playwright/no-skipped-test
320318
test.skip(
321319
browserName === 'webkit',
322320
'navigator.clipboard is not working with webkit and playwright',
@@ -351,7 +349,6 @@ test.describe('Doc Header', () => {
351349
});
352350

353351
test('it checks the copy link button', async ({ page, browserName }) => {
354-
// eslint-disable-next-line playwright/no-skipped-test
355352
test.skip(
356353
browserName === 'webkit',
357354
'navigator.clipboard is not working with webkit and playwright',

src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ test.describe('Document list members', () => {
151151
await expect(soloOwner).toBeVisible();
152152

153153
await list.click({
154-
// eslint-disable-next-line playwright/no-force-option
155154
force: true, // Force click to close the dropdown
156155
});
157156
const newUserEmail = await addNewMember(page, 0, 'Owner');
@@ -163,13 +162,11 @@ test.describe('Document list members', () => {
163162
await currentUserRole.click();
164163
await expect(soloOwner).toBeHidden();
165164
await list.click({
166-
// eslint-disable-next-line playwright/no-force-option
167165
force: true, // Force click to close the dropdown
168166
});
169167

170168
await newUserRoles.click();
171169
await list.click({
172-
// eslint-disable-next-line playwright/no-force-option
173170
force: true, // Force click to close the dropdown
174171
});
175172

src/frontend/apps/e2e/__tests__/app-impress/doc-routing.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ test.describe('Doc Routing', () => {
4040
});
4141

4242
test('checks 404 on docs/[id] page', async ({ page }) => {
43-
// eslint-disable-next-line playwright/no-wait-for-timeout
4443
await page.waitForTimeout(300);
4544

4645
await page.goto('/docs/some-unknown-doc');

src/frontend/apps/e2e/__tests__/app-impress/doc-tree.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable playwright/no-conditional-in-test */
21
import { expect, test } from '@playwright/test';
32

43
import {

src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ test.describe('Doc Visibility', () => {
1515
});
1616

1717
test('It checks the copy link button', async ({ page, browserName }) => {
18-
// eslint-disable-next-line playwright/no-skipped-test
1918
test.skip(
2019
browserName === 'webkit',
2120
'navigator.clipboard is not working with webkit and playwright',
@@ -119,8 +118,11 @@ test.describe('Doc Visibility: Restricted', () => {
119118
.click();
120119

121120
const otherBrowser = BROWSERS.find((b) => b !== browserName);
121+
if (!otherBrowser) {
122+
throw new Error('No alternative browser found');
123+
}
122124

123-
await keyCloakSignIn(page, otherBrowser!);
125+
await keyCloakSignIn(page, otherBrowser);
124126

125127
await expect(page.getByTestId('header-logo-link')).toBeVisible({
126128
timeout: 10000,
@@ -151,6 +153,9 @@ test.describe('Doc Visibility: Restricted', () => {
151153
});
152154

153155
const otherBrowser = BROWSERS.find((b) => b !== browserName);
156+
if (!otherBrowser) {
157+
throw new Error('No alternative browser found');
158+
}
154159
const username = `user@${otherBrowser}.test`;
155160
await inputSearch.fill(username);
156161
await page.getByRole('option', { name: username }).click();
@@ -174,7 +179,7 @@ test.describe('Doc Visibility: Restricted', () => {
174179
})
175180
.click();
176181

177-
await keyCloakSignIn(page, otherBrowser!);
182+
await keyCloakSignIn(page, otherBrowser);
178183

179184
await expect(page.getByTestId('header-logo-link')).toBeVisible();
180185

@@ -449,7 +454,10 @@ test.describe('Doc Visibility: Authenticated', () => {
449454
.click();
450455

451456
const otherBrowser = BROWSERS.find((b) => b !== browserName);
452-
await keyCloakSignIn(page, otherBrowser!);
457+
if (!otherBrowser) {
458+
throw new Error('No alternative browser found');
459+
}
460+
await keyCloakSignIn(page, otherBrowser);
453461

454462
await expect(page.getByTestId('header-logo-link')).toBeVisible({
455463
timeout: 10000,
@@ -537,7 +545,10 @@ test.describe('Doc Visibility: Authenticated', () => {
537545
.click();
538546

539547
const otherBrowser = BROWSERS.find((b) => b !== browserName);
540-
await keyCloakSignIn(page, otherBrowser!);
548+
if (!otherBrowser) {
549+
throw new Error('No alternative browser found');
550+
}
551+
await keyCloakSignIn(page, otherBrowser);
541552

542553
await expect(page.getByTestId('header-logo-link')).toBeVisible();
543554

0 commit comments

Comments
 (0)