Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to

### Changed

- ⬆️ Bump eslint to V9 #1071
- ⚡️(frontend) improve accessibility:
- #1248
- #1235
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,6 @@ bump-packages-version: ## bump the version of the project - VERSION_TYPE can be
cd ./src/frontend/apps/e2e/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
cd ./src/frontend/apps/impress/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
cd ./src/frontend/servers/y-provider/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
cd ./src/frontend/packages/eslint-config-impress/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
cd ./src/frontend/packages/eslint-plugin-docs/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
cd ./src/frontend/packages/i18n/ && yarn version --no-git-tag-version --$(VERSION_TYPE)
.PHONY: bump-packages-version
1 change: 0 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@hocuspocus/provider",
"@hocuspocus/server",
"docx",
"eslint",
"fetch-mock",
"node",
"node-fetch",
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ WORKDIR /home/frontend/
COPY ./src/frontend/package.json ./package.json
COPY ./src/frontend/yarn.lock ./yarn.lock
COPY ./src/frontend/apps/impress/package.json ./apps/impress/package.json
COPY ./src/frontend/packages/eslint-config-impress/package.json ./packages/eslint-config-impress/package.json
COPY ./src/frontend/packages/eslint-plugin-docs/package.json ./packages/eslint-plugin-docs/package.json

RUN yarn install --frozen-lockfile

COPY .dockerignore ./.dockerignore
COPY ./src/frontend/.prettierrc.js ./.prettierrc.js
COPY ./src/frontend/packages/eslint-config-impress ./packages/eslint-config-impress
COPY ./src/frontend/packages/eslint-plugin-docs ./packages/eslint-plugin-docs
COPY ./src/frontend/apps/impress ./apps/impress

### ---- Front-end builder image ----
Expand Down
9 changes: 0 additions & 9 deletions src/frontend/apps/e2e/.eslintrc.js

This file was deleted.

11 changes: 7 additions & 4 deletions src/frontend/apps/e2e/__tests__/app-impress/auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ import { keyCloakSignIn } from './utils-common';
const saveStorageState = async (
browserConfig: FullProject<unknown, unknown>,
) => {
const browserName = browserConfig?.name || 'chromium';
if (!browserConfig) {
throw new Error('No browser config found');
}

const browserName = browserConfig.name || 'chromium';

const { storageState, ...useConfig } = browserConfig?.use;
const { storageState, ...useConfig } = browserConfig.use;
const browser = await chromium.launch();
const context = await browser.newContext(useConfig);
const page = await context.newPage();

try {
// eslint-disable-next-line playwright/no-networkidle
await page.goto('/', { waitUntil: 'networkidle' });
await page.content();
await expect(page.getByText('Docs').first()).toBeVisible();
Expand Down Expand Up @@ -45,11 +50,9 @@ const saveStorageState = async (
};

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

await saveStorageState(chromeConfig);
await saveStorageState(webkitConfig);
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/apps/e2e/__tests__/app-impress/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test.describe('Config', () => {
await expect(image).toBeVisible();

// Wait for the media-check to be processed
// eslint-disable-next-line playwright/no-wait-for-timeout

await page.waitForTimeout(1000);

// Check src of image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable playwright/no-conditional-expect */
import path from 'path';

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

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

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

// Wait for the media-check to be processed
// eslint-disable-next-line playwright/no-wait-for-timeout

await page.waitForTimeout(1000);

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

/* eslint-disable playwright/no-conditional-expect */
/* eslint-disable playwright/no-conditional-in-test */
if (!ai_transform && !ai_translate) {
await expect(page.getByRole('button', { name: 'AI' })).toBeHidden();
return;
Expand All @@ -418,8 +416,6 @@ test.describe('Doc Editor', () => {
page.getByRole('menuitem', { name: 'Language' }),
).toBeHidden();
}
/* eslint-enable playwright/no-conditional-expect */
/* eslint-enable playwright/no-conditional-in-test */
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ test.describe('Doc grid dnd', () => {
expect(draggableBoundingBox).toBeDefined();
expect(dropZoneBoundingBox).toBeDefined();

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

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

const noDropAndNoDragBoundigBox = await noDropAndNoDrag.boundingBox();

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

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

const noDropAndNoDragBoundigBox = await noDropAndNoDrag.boundingBox();

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

await page.mouse.move(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ test.describe('Doc Header', () => {
page,
browserName,
}) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(
browserName === 'webkit',
'navigator.clipboard is not working with webkit and playwright',
Expand Down Expand Up @@ -316,7 +315,6 @@ test.describe('Doc Header', () => {
});

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

test('it checks the copy link button', async ({ page, browserName }) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(
browserName === 'webkit',
'navigator.clipboard is not working with webkit and playwright',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ test.describe('Document list members', () => {
await expect(soloOwner).toBeVisible();

await list.click({
// eslint-disable-next-line playwright/no-force-option
force: true, // Force click to close the dropdown
});
const newUserEmail = await addNewMember(page, 0, 'Owner');
Expand All @@ -163,13 +162,11 @@ test.describe('Document list members', () => {
await currentUserRole.click();
await expect(soloOwner).toBeHidden();
await list.click({
// eslint-disable-next-line playwright/no-force-option
force: true, // Force click to close the dropdown
});

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ test.describe('Doc Routing', () => {
});

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

await page.goto('/docs/some-unknown-doc');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable playwright/no-conditional-in-test */
import { expect, test } from '@playwright/test';

import {
Expand Down
21 changes: 16 additions & 5 deletions src/frontend/apps/e2e/__tests__/app-impress/doc-visibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ test.describe('Doc Visibility', () => {
});

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

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

await keyCloakSignIn(page, otherBrowser!);
await keyCloakSignIn(page, otherBrowser);

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

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

await keyCloakSignIn(page, otherBrowser!);
await keyCloakSignIn(page, otherBrowser);

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

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

const otherBrowser = BROWSERS.find((b) => b !== browserName);
await keyCloakSignIn(page, otherBrowser!);
if (!otherBrowser) {
throw new Error('No alternative browser found');
}
await keyCloakSignIn(page, otherBrowser);

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

const otherBrowser = BROWSERS.find((b) => b !== browserName);
await keyCloakSignIn(page, otherBrowser!);
if (!otherBrowser) {
throw new Error('No alternative browser found');
}
await keyCloakSignIn(page, otherBrowser);

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

Expand Down
1 change: 0 additions & 1 deletion src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ test.describe('Header', () => {
* La gaufre load a js file from a remote server,
* it takes some time to load the file and have the interaction available
*/
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1500);

await header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const CONFIG = {

export const overrideConfig = async (
page: Page,
newConfig: { [K in keyof typeof CONFIG]?: unknown },
newConfig: { [_K in keyof typeof CONFIG]?: unknown },
) =>
await page.route('**/api/v1.0/config/', async (route) => {
const request = route.request();
Expand Down
20 changes: 20 additions & 0 deletions src/frontend/apps/e2e/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from '@eslint/config-helpers';
import docsPlugin from 'eslint-plugin-docs';

const eslintConfig = defineConfig([
{
files: ['**/*.ts', '**/*.mjs'],
plugins: {
docs: docsPlugin,
},
extends: ['docs/playwright'],
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: ['./tsconfig.json'],
},
},
},
]);

export default eslintConfig;
4 changes: 2 additions & 2 deletions src/frontend/apps/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "3.5.0",
"private": true,
"scripts": {
"lint": "eslint . --ext .ts",
"lint": "eslint",
"install-playwright": "playwright install --with-deps",
"test": "playwright test",
"test:ui": "yarn test --ui",
Expand All @@ -15,7 +15,7 @@
"@playwright/test": "1.54.2",
"@types/node": "*",
"@types/pdf-parse": "1.1.5",
"eslint-config-impress": "*",
"eslint-plugin-docs": "*",
"typescript": "*"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/apps/e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"incremental": true
},
"include": ["**/*.ts", "**/*.d.ts"],
"include": ["**/*.ts", "**/*.d.ts", "**/*.mjs"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion src/frontend/apps/e2e/type/convert-stream.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module 'convert-stream' {
export function toBuffer(
readableStream: NodeJS.ReadableStream,
_readableStream: NodeJS.ReadableStream,
): Promise<Buffer>;
}
14 changes: 0 additions & 14 deletions src/frontend/apps/impress/.eslintrc.js

This file was deleted.

Loading
Loading