From 6f0bded0a28f97104d6d2fd58fdf39c4986aa79c Mon Sep 17 00:00:00 2001 From: DarkSky Date: Sun, 5 Feb 2023 17:53:14 +0800 Subject: [PATCH] Revert "fix:test case (#763)" This reverts commit c0b410a1b207d83dd82c8e65009f8d8507b79d80. --- packages/app/next.config.js | 2 +- packages/data-center/src/workspace-unit-collection.spec.ts | 2 +- tests/change-page-mode.spec.ts | 6 +++--- tests/contact-us.spec.ts | 2 +- tests/exception-page.spec.ts | 2 +- tests/invite-code-page.spec.ts | 2 +- tests/layout.spec.ts | 2 +- tests/local-first-delete-page.spec.ts | 2 +- tests/local-first-export-page.spec.ts | 2 +- tests/local-first-favorite-page.spec.ts | 2 +- tests/local-first-favorites-items.spec.ts | 2 +- tests/local-first-new-page.spec.ts | 2 +- tests/local-first-openpage-newtab.spec.ts | 2 +- tests/local-first-restore-page.spec.ts | 2 +- tests/local-first-show-delete-modal.spec.ts | 2 +- tests/local-first-trash-page.spec.ts | 2 +- tests/login.spec.ts | 2 +- tests/quick-search.spec.ts | 6 +++--- tests/shortcuts.spec.ts | 2 +- tests/theme.spec.ts | 2 +- 20 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/app/next.config.js b/packages/app/next.config.js index a7ca2bbe8c..cd8eb2d10c 100644 --- a/packages/app/next.config.js +++ b/packages/app/next.config.js @@ -12,7 +12,7 @@ const EDITOR_VERSION = enableDebugLocal const profileTarget = { ac: '100.85.73.88:12001', dev: '100.77.180.48:11001', - test: '100.85.73.88:12001', + test: '100.77.180.48:11001', stage: '', pro: 'http://pathfinder.affine.pro', local: '127.0.0.1:3000', diff --git a/packages/data-center/src/workspace-unit-collection.spec.ts b/packages/data-center/src/workspace-unit-collection.spec.ts index 93f0027a1c..405fc82370 100644 --- a/packages/data-center/src/workspace-unit-collection.spec.ts +++ b/packages/data-center/src/workspace-unit-collection.spec.ts @@ -55,7 +55,7 @@ test.describe.serial('workspace meta collection observable', () => { workspaceUnitCollection.once( 'change', (event: WorkspaceUnitCollectionChangeEvent) => { - expect(event.deleted?.[0]?.id).toEqual('123'); + expect(event.deleted?.id).toEqual('123'); } ); scope.remove('123'); diff --git a/tests/change-page-mode.spec.ts b/tests/change-page-mode.spec.ts index 92a5511215..1ff308879c 100644 --- a/tests/change-page-mode.spec.ts +++ b/tests/change-page-mode.spec.ts @@ -3,8 +3,8 @@ import { loadPage } from './libs/load-page.js'; import { clickPageMoreActions } from './libs/page-logic.js'; loadPage(); -test.skip('Change page mode(Paper or Edgeless)', () => { - test.skip('Switch to edgeless by switch edgeless item', async ({ page }) => { +test.describe('Change page mode(Paper or Edgeless)', () => { + test('Switch to edgeless by switch edgeless item', async ({ page }) => { const switcher = page.locator('[data-testid=editor-mode-switcher]'); const box = await switcher.boundingBox(); expect(box?.x).not.toBeUndefined(); @@ -35,7 +35,7 @@ test.skip('Change page mode(Paper or Edgeless)', () => { expect(await edgeless.isVisible()).toBe(true); }); - test.skip('Convert to edgeless by editor header items', async ({ page }) => { + test('Convert to edgeless by editor header items', async ({ page }) => { await clickPageMoreActions(page); const menusEdgelessItem = page.getByTestId('editor-option-menu-edgeless'); await menusEdgelessItem.click(); diff --git a/tests/contact-us.spec.ts b/tests/contact-us.spec.ts index 4db568bffe..370ed144b7 100644 --- a/tests/contact-us.spec.ts +++ b/tests/contact-us.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); -test.skip('Open contact us', () => { +test.describe('Open contact us', () => { test.skip('Click about us', async ({ page }) => { const currentWorkspace = page.getByTestId('current-workspace'); await currentWorkspace.click(); diff --git a/tests/exception-page.spec.ts b/tests/exception-page.spec.ts index f3e5af8c7b..c86a8e2a19 100644 --- a/tests/exception-page.spec.ts +++ b/tests/exception-page.spec.ts @@ -4,7 +4,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); // ps aux | grep 8080 -test.skip('exception page', () => { +test.describe('exception page', () => { test('visit 404 page', async ({ page }) => { await page.goto('http://localhost:8080/404'); await page.waitForTimeout(1000); diff --git a/tests/invite-code-page.spec.ts b/tests/invite-code-page.spec.ts index 7f5b4fbe5d..212061dd46 100644 --- a/tests/invite-code-page.spec.ts +++ b/tests/invite-code-page.spec.ts @@ -4,7 +4,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); // ps aux | grep 8080 -test.skip('invite code page', () => { +test.describe('invite code page', () => { test('the link has expired', async ({ page }) => { await page.goto('http://localhost:8080//invite/abc'); await page.waitForTimeout(1000); diff --git a/tests/layout.spec.ts b/tests/layout.spec.ts index a809deeb23..8087aa7580 100644 --- a/tests/layout.spec.ts +++ b/tests/layout.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); -test.skip('Layout ui', () => { +test.describe('Layout ui', () => { test('Collapse Sidebar', async ({ page }) => { await page.getByTestId('sliderBar-arrowButton').click(); const sliderBarArea = page.getByTestId('sliderBar'); diff --git a/tests/local-first-delete-page.spec.ts b/tests/local-first-delete-page.spec.ts index 5108efe40f..efc6297b0b 100644 --- a/tests/local-first-delete-page.spec.ts +++ b/tests/local-first-delete-page.spec.ts @@ -4,7 +4,7 @@ import { newPage } from './libs/page-logic.js'; loadPage(); -test.skip('Local first delete page', () => { +test.describe('Local first delete page', () => { test('New a page , then delete it in all pages, permanently delete it', async ({ page, }) => { diff --git a/tests/local-first-export-page.spec.ts b/tests/local-first-export-page.spec.ts index d4d6037d7f..090974ea86 100644 --- a/tests/local-first-export-page.spec.ts +++ b/tests/local-first-export-page.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage, clickPageMoreActions } from './libs/page-logic.js'; loadPage(); -test.skip('Local first export page', () => { +test.describe('Local first export page', () => { test('New a page ,then open it and export html', async ({ page }) => { await newPage(page); await page.getByPlaceholder('Title').click(); diff --git a/tests/local-first-favorite-page.spec.ts b/tests/local-first-favorite-page.spec.ts index fcb64f9a6f..6f1193065e 100644 --- a/tests/local-first-favorite-page.spec.ts +++ b/tests/local-first-favorite-page.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage, clickPageMoreActions } from './libs/page-logic.js'; loadPage(); -test.skip('Local first favorite and cancel favorite page', () => { +test.describe('Local first favorite and cancel favorite page', () => { test('New a page and open it ,then favorite it', async ({ page }) => { await newPage(page); await page.getByPlaceholder('Title').click(); diff --git a/tests/local-first-favorites-items.spec.ts b/tests/local-first-favorites-items.spec.ts index 950e9091e5..6dcc3c3073 100644 --- a/tests/local-first-favorites-items.spec.ts +++ b/tests/local-first-favorites-items.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage, clickPageMoreActions } from './libs/page-logic.js'; loadPage(); -test.skip('Local first favorite items ui', () => { +test.describe('Local first favorite items ui', () => { test('Show favorite items in sidebar', async ({ page }) => { await newPage(page); await page.getByPlaceholder('Title').click(); diff --git a/tests/local-first-new-page.spec.ts b/tests/local-first-new-page.spec.ts index 8886bab0b5..418bcc0413 100644 --- a/tests/local-first-new-page.spec.ts +++ b/tests/local-first-new-page.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage } from './libs/page-logic.js'; loadPage(); -test.skip('local first new page', () => { +test.describe('local first new page', () => { test('click btn new page', async ({ page }) => { const originPageId = page.url().split('/').reverse()[0]; await newPage(page); diff --git a/tests/local-first-openpage-newtab.spec.ts b/tests/local-first-openpage-newtab.spec.ts index 1734b24b4a..5ca02dc764 100644 --- a/tests/local-first-openpage-newtab.spec.ts +++ b/tests/local-first-openpage-newtab.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage } from './libs/page-logic.js'; loadPage(); -test.skip('local first new page', () => { +test.describe('local first new page', () => { test('click btn bew page and open in tab', async ({ page }) => { await newPage(page); await page.getByPlaceholder('Title').click(); diff --git a/tests/local-first-restore-page.spec.ts b/tests/local-first-restore-page.spec.ts index 9dbbf21363..89bda15a98 100644 --- a/tests/local-first-restore-page.spec.ts +++ b/tests/local-first-restore-page.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage } from './libs/page-logic.js'; loadPage(); -test.skip('Local first delete page', () => { +test.describe('Local first delete page', () => { test('New a page , then delete it in all pages, restore it', async ({ page, }) => { diff --git a/tests/local-first-show-delete-modal.spec.ts b/tests/local-first-show-delete-modal.spec.ts index 4f8f5d402b..59c24ce4ed 100644 --- a/tests/local-first-show-delete-modal.spec.ts +++ b/tests/local-first-show-delete-modal.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage, clickPageMoreActions } from './libs/page-logic.js'; loadPage(); -test.skip('Local first delete page', () => { +test.describe('Local first delete page', () => { test('New a page ,then open it and show delete modal', async ({ page }) => { await newPage(page); await page.getByPlaceholder('Title').click(); diff --git a/tests/local-first-trash-page.spec.ts b/tests/local-first-trash-page.spec.ts index c9fa82a0e9..9acce37bea 100644 --- a/tests/local-first-trash-page.spec.ts +++ b/tests/local-first-trash-page.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; import { newPage } from './libs/page-logic.js'; loadPage(); -test.skip('Local first trash page', () => { +test.describe('Local first trash page', () => { test('New a page , then delete it in all pages, finally find it in trash', async ({ page, }) => { diff --git a/tests/login.spec.ts b/tests/login.spec.ts index 78ae64bb9e..ed7185259f 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); -test.skip('Login Flow', () => { +test.describe('Login Flow', () => { test.skip('Open login modal by click current workspace', async ({ page }) => { await page.getByTestId('current-workspace').click(); await page.waitForTimeout(800); diff --git a/tests/quick-search.spec.ts b/tests/quick-search.spec.ts index 7774324db8..9d4dbf2add 100644 --- a/tests/quick-search.spec.ts +++ b/tests/quick-search.spec.ts @@ -21,7 +21,7 @@ async function assertResultList(page: Page, texts: string[]) { expect(actual).toEqual(texts); } -test.skip('Open quick search', () => { +test.describe('Open quick search', () => { test('Click slider bar button', async ({ page }) => { await newPage(page); const quickSearchButton = page.locator( @@ -50,7 +50,7 @@ test.skip('Open quick search', () => { }); }); -test.skip('Add new page in quick search', () => { +test.describe('Add new page in quick search', () => { // FIXME: not working test('Create a new page without keyword', async ({ page }) => { await newPage(page); @@ -72,7 +72,7 @@ test.skip('Add new page in quick search', () => { }); }); -test.skip('Search and select', () => { +test.describe('Search and select', () => { test('Create a new page and search this page', async ({ page }) => { await newPage(page); await openQuickSearchByShortcut(page); diff --git a/tests/shortcuts.spec.ts b/tests/shortcuts.spec.ts index 2f12f31687..c763fb7f82 100644 --- a/tests/shortcuts.spec.ts +++ b/tests/shortcuts.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); -test.skip('Shortcuts Modal', () => { +test.describe('Shortcuts Modal', () => { test('Open shortcuts modal', async ({ page }) => { const faqIcon = page.locator('[data-testid=faq-icon]'); const box = await faqIcon.boundingBox(); diff --git a/tests/theme.spec.ts b/tests/theme.spec.ts index b13ae615d0..c6e7641047 100644 --- a/tests/theme.spec.ts +++ b/tests/theme.spec.ts @@ -3,7 +3,7 @@ import { loadPage } from './libs/load-page.js'; loadPage(); -test.skip('Change Theme', () => { +test.describe('Change Theme', () => { test('default white', async ({ page }) => { await page.waitForSelector('html'); const root = page.locator('html');