diff --git a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx index 017a090cfd..24a07245ee 100644 --- a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx +++ b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx @@ -32,6 +32,7 @@ const PopoverContent = () => { return ( <> { toggleFavoritePage(id); toast(!favorite ? 'Removed to Favourites' : 'Added to Favourites'); diff --git a/tests/local-first-favorite-page.spec.ts b/tests/local-first-favorite-page.spec.ts new file mode 100644 index 0000000000..17732f7626 --- /dev/null +++ b/tests/local-first-favorite-page.spec.ts @@ -0,0 +1,32 @@ +import { test, expect } from '@playwright/test'; +import { loadPage } from './libs/load-page'; + +loadPage(); + +test.describe('Local first favorite page', () => { + test('New a page ,then open it and show favorite', async ({ page }) => { + await page.getByText('New Page').click(); + await page.getByPlaceholder('Title').click(); + await page.getByPlaceholder('Title').fill('this is a new page to favorite'); + + await page.getByRole('link', { name: 'All pages' }).click(); + + const cell = await page.getByRole('cell', { + name: 'this is a new page to favorite', + }); + + expect(cell).not.toBeUndefined(); + + await cell.click(); + + await page + .getByTestId('editor-header-items') + .getByRole('button') + .nth(2) + .click(); + + const favoriteBtn = page.getByTestId('editor-option-menu-favorite'); + + await favoriteBtn.click(); + }); +});