feat(core): mode in query string (#7904)

This commit is contained in:
EYHN
2024-08-16 10:59:43 +00:00
parent 83716c2fd9
commit c822594882
16 changed files with 174 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ import {
getPageOperationButton,
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import { getCurrentDocIdFromUrl } from '@affine-test/kit/utils/url';
import { expect } from '@playwright/test';
test('page delete -> refresh page -> it should be disappear', async ({
@@ -18,7 +19,7 @@ test('page delete -> refresh page -> it should be disappear', async ({
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page delete');
const newPageId = page.url().split('/').reverse()[0];
const newPageId = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page delete',
@@ -54,7 +55,7 @@ test('page delete -> create new page -> refresh page -> new page should be appea
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page delete');
const newPageDeleteId = page.url().split('/').reverse()[0];
const newPageDeleteId = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
const cellDelete = page.getByRole('cell', {
name: 'this is a new page delete',
@@ -80,13 +81,13 @@ test('page delete -> create new page -> refresh page -> new page should be appea
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page1');
await page.waitForTimeout(1000);
const newPageId1 = page.url().split('/').reverse()[0];
const newPageId1 = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page2');
await page.waitForTimeout(1000);
const newPageId2 = page.url().split('/').reverse()[0];
const newPageId2 = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
await page.reload();
await getPageItem(page, newPageId1).click();
@@ -109,13 +110,13 @@ test('delete multiple pages -> create multiple pages -> refresh', async ({
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page1');
const newPageId1 = page.url().split('/').reverse()[0];
const newPageId1 = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
// create 2nd page
await clickNewPageButton(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page2');
const newPageId2 = page.url().split('/').reverse()[0];
const newPageId2 = getCurrentDocIdFromUrl(page);
await page.getByTestId('all-pages').click();
// 1st cell to be deleted