test: add workspace ref in e2e (#3217)

This commit is contained in:
Alex Yang authored and GitHub committed 2023-07-13 12:41:46 +00:00
1 parent 64cf297399
commit d18df12951
18 files changed
+140 -101

No files matched your search

@@ -9,7 +9,7 @@ import {
} from '@affine-test/kit/utils/page-logic';
import { expect } from '@playwright/test';
test('Show favorite items in sidebar', async ({ page }) => {
test('Show favorite items in sidebar', async ({ page, workspace }) => {
await openHomePage(page);
await waitEditorLoad(page);
await newPage(page);
@@ -32,9 +32,12 @@ test('Show favorite items in sidebar', async ({ page }) => {
expect(await favoriteListItemInSidebar.textContent()).toBe(
'this is a new page to favorite'
);
const currentWorkspace = await workspace.current();
expect(currentWorkspace.flavour).toContain('local');
});
test('Show favorite reference in sidebar', async ({ page }) => {
test('Show favorite reference in sidebar', async ({ page, workspace }) => {
await openHomePage(page);
await waitEditorLoad(page);
await newPage(page);
@@ -69,10 +72,14 @@ test('Show favorite reference in sidebar', async ({ page }) => {
await expect(
page.locator('[data-type="favorite-list-item"] >> text=Another page')
).toBeVisible();
const currentWorkspace = await workspace.current();
expect(currentWorkspace.flavour).toContain('local');
});
test("Deleted page's reference will not be shown in sidebar", async ({
page,
workspace,
}) => {
await openHomePage(page);
await waitEditorLoad(page);
@@ -116,4 +123,7 @@ test("Deleted page's reference will not be shown in sidebar", async ({
);
await expect(collapseButton).not.toBeVisible();
const currentWorkspace = await workspace.current();
expect(currentWorkspace.flavour).toContain('local');
});