From b28ff8f632aabeb406d3ef883c3f9a2a4463b6a1 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 24 Jul 2025 12:38:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8(frontend)=20fix=20lint=20warning?= =?UTF-8?q?=20about=20unnecessary=20assertion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Recent upgrade highlighted a lint warning about an unnecessary assertion in the BlockNoteToolbar component. This commit removes the assertion to resolve the warning. - Fix a test - upgrade causes an error on a selector click --- .../app-impress/doc-member-list.spec.ts | 16 +++++++++++++--- .../BlockNoteToolBar/BlockNoteToolbar.tsx | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts index e7d47a78..47597069 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-list.spec.ts @@ -149,7 +149,11 @@ test.describe('Document list members', () => { `You are the sole owner of this group, make another member the group owner before you can change your own role or be removed from your document.`, ); await expect(soloOwner).toBeVisible(); - await list.click(); + + 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'); const newUser = list.getByTestId(`doc-share-member-row-${newUserEmail}`); const newUserRoles = newUser.getByLabel('doc-role-dropdown'); @@ -158,10 +162,16 @@ test.describe('Document list members', () => { await currentUserRole.click(); await expect(soloOwner).toBeHidden(); - await list.click(); + 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(); + await list.click({ + // eslint-disable-next-line playwright/no-force-option + force: true, // Force click to close the dropdown + }); await currentUserRole.click(); await page.getByLabel('Administrator').click(); diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/BlockNoteToolbar.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/BlockNoteToolbar.tsx index d59a09ab..6b7a8181 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/BlockNoteToolbar.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/BlockNoteToolbar.tsx @@ -5,7 +5,7 @@ import { getFormattingToolbarItems, useDictionary, } from '@blocknote/react'; -import React, { JSX, useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useConfig } from '@/core/config/api'; @@ -50,7 +50,7 @@ export const BlockNoteToolbar = () => { ); } - return toolbarItems as JSX.Element[]; + return toolbarItems; }, [dict, t]); const formattingToolbar = useCallback(() => {