test(e2e): codestyle tuning

This commit is contained in:
Junyi Du
2022-04-26 14:31:03 +08:00
parent dc8be8cdfc
commit 10eb18a137
3 changed files with 5 additions and 6 deletions

View File

@@ -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++) {

View File

@@ -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)
})