소스 검색

test(e2e): codestyle tuning

Junyi Du 3 년 전
부모
커밋
10eb18a137
3개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 5
      e2e-tests/editor.spec.ts
  2. 0 0
      e2e-tests/logseq-url.spec.ts
  3. 2 1
      e2e-tests/sidebar.spec.ts

+ 3 - 5
e2e-tests/editor.spec.ts

@@ -1,6 +1,6 @@
 import { expect } from '@playwright/test'
 import { test } from './fixtures'
-import { createRandomPage, enterNextBlock, systemModifier, IsMac, getIsWebAPIClipboardSupported, captureConsoleWithPrefix } from './utils'
+import { createRandomPage, enterNextBlock, systemModifier, IsMac } from './utils'
 import { dispatch_kb_events } from './util/keyboard-events'
 import * as kb_events from './util/keyboard-events'
 
@@ -144,8 +144,6 @@ test(
 
 test('copy & paste block ref and replace its content', async ({ page, block }) => {
     await createRandomPage(page)
-    let IsWebAPIClipboardSupported = await getIsWebAPIClipboardSupported(page)
-    let promise_capture: Promise<string> = null
 
     await block.mustFill('Some random text')
     // FIXME: copy instantly will make content disappear
@@ -164,10 +162,10 @@ test('copy & paste block ref and replace its content', async ({ page, block }) =
     }
     await page.keyboard.press('Enter')
 
-    const blockRef$ = page.locator('.block-ref >> text="Some random text"');
+    const blockRef = page.locator('.block-ref >> text="Some random text"');
 
     // Check if the newly created block-ref has the same referenced content
-    await expect(blockRef$).toHaveCount(1);
+    await expect(blockRef).toHaveCount(1);
 
     // Move cursor into the block ref
     for (let i = 0; i < 4; i++) {

+ 0 - 0
e2e-tests/logseq_url.spec.ts → e2e-tests/logseq-url.spec.ts


+ 2 - 1
e2e-tests/sidebar.spec.ts

@@ -31,7 +31,8 @@ test('favorite item and recent item test', async ({ page }) => {
   expect(favs.length).toEqual(previous_fav_count)
 
   // click from fav page
-  await page.click(':nth-match(.recent-item a, 2)')
+  page.click(':nth-match(.recent-item a, 2)')
+  await page.waitForNavigation()
   expect(await page.innerText('.page-title .title')).toBe(another_page_name)
 })