Skip to content

Commit b28ff8f

Browse files
committed
🚨(frontend) fix lint warning about unnecessary assertion
- 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
1 parent 14b7cdf commit b28ff8f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ test.describe('Document list members', () => {
149149
`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.`,
150150
);
151151
await expect(soloOwner).toBeVisible();
152-
await list.click();
152+
153+
await list.click({
154+
// eslint-disable-next-line playwright/no-force-option
155+
force: true, // Force click to close the dropdown
156+
});
153157
const newUserEmail = await addNewMember(page, 0, 'Owner');
154158
const newUser = list.getByTestId(`doc-share-member-row-${newUserEmail}`);
155159
const newUserRoles = newUser.getByLabel('doc-role-dropdown');
@@ -158,10 +162,16 @@ test.describe('Document list members', () => {
158162

159163
await currentUserRole.click();
160164
await expect(soloOwner).toBeHidden();
161-
await list.click();
165+
await list.click({
166+
// eslint-disable-next-line playwright/no-force-option
167+
force: true, // Force click to close the dropdown
168+
});
162169

163170
await newUserRoles.click();
164-
await list.click();
171+
await list.click({
172+
// eslint-disable-next-line playwright/no-force-option
173+
force: true, // Force click to close the dropdown
174+
});
165175

166176
await currentUserRole.click();
167177
await page.getByLabel('Administrator').click();

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/BlockNoteToolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
getFormattingToolbarItems,
66
useDictionary,
77
} from '@blocknote/react';
8-
import React, { JSX, useCallback, useMemo, useState } from 'react';
8+
import React, { useCallback, useMemo, useState } from 'react';
99
import { useTranslation } from 'react-i18next';
1010

1111
import { useConfig } from '@/core/config/api';
@@ -50,7 +50,7 @@ export const BlockNoteToolbar = () => {
5050
);
5151
}
5252

53-
return toolbarItems as JSX.Element[];
53+
return toolbarItems;
5454
}, [dict, t]);
5555

5656
const formattingToolbar = useCallback(() => {

0 commit comments

Comments
 (0)