Skip to content
Open
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
@@ -10,6 +10,7 @@ and this project adheres to

### Changed

- ⬆️ Bump eslint to V9 #1071
- ⚡️(frontend) improve accessibility:
- #1248
- #1235
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
@@ -23,7 +23,6 @@
"@hocuspocus/provider",
"@hocuspocus/server",
"docx",
"eslint",
"fetch-mock",
"node",
"node-fetch",
4 changes: 2 additions & 2 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 ----
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
@@ -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();
@@ -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);
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
@@ -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
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';
@@ -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
@@ -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
@@ -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;
@@ -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 */
});
});

Original file line number Diff line number Diff line change
@@ -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(
@@ -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(
@@ -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(
Original file line number Diff line number Diff line change
@@ -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',
@@ -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',
@@ -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',
Original file line number Diff line number Diff line change
@@ -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');
@@ -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
});

Original file line number Diff line number Diff line change
@@ -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');
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 {
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
@@ -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',
@@ -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,
@@ -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();
@@ -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();

@@ -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,
@@ -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();

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
@@ -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
Original file line number Diff line number Diff line change
@@ -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();
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
@@ -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",
@@ -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": {
4 changes: 2 additions & 2 deletions src/frontend/apps/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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
Oops, something went wrong.
Loading
Oops, something went wrong.