🚨(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
This commit is contained in:
Anthony LC
2025-07-24 12:38:31 +02:00
parent 14b7cdf561
commit b28ff8f632
2 changed files with 15 additions and 5 deletions

View File

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

View File

@@ -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(() => {