Files
logseq/e2e-tests/basic.with-diacritics.spec.ts
Tienson Qin 6aba8c3241 Improve long page editing performance (#3855)
* Remove expensive parsing when saving files

* Add limit to page blocks query

* Don't collapse block's body to make it compatible with other tools

* Alert if there're unsaved changes when switching graphs

* DB schema migration for :block/collapsed? from it's property

Co-authored-by: Andelf <andelf@gmail.com>
2022-01-18 10:37:31 +08:00

40 lines
1.4 KiB
TypeScript

import { expect } from '@playwright/test'
import { test } from './fixtures'
import { IsMac, createRandomPage, newBlock, randomString, lastInnerBlock, activateNewPage} from './utils'
test('create page and blocks (diacritics)', async ({ page }) => {
let hotkeyOpenLink = 'Control+o'
let hotkeyBack = 'Control+['
if (IsMac) {
hotkeyOpenLink = 'Meta+o'
hotkeyBack = 'Meta+['
}
const rand = randomString(20)
// diacritic opening test
await createRandomPage(page)
await page.fill(':nth-match(textarea, 1)', '[[Einführung in die Allgemeine Sprachwissenschaft' + rand + ']] diacritic-block-1')
await page.keyboard.press(hotkeyOpenLink)
// build target Page with diacritics
await activateNewPage(page)
await page.type(':nth-match(textarea, 1)', 'Diacritic title test content')
await page.keyboard.press('Enter')
await page.fill(':nth-match(textarea, 1)', '[[Einführung in die Allgemeine Sprachwissenschaft' + rand + ']] diacritic-block-2')
await page.keyboard.press(hotkeyBack)
// check if diacritics are indexed
await page.click('#search-button')
await page.waitForSelector('[placeholder="Search or create page"]')
await page.fill('[placeholder="Search or create page"]', 'Einführung in die Allgemeine Sprachwissenschaft' + rand)
await page.waitForTimeout(500)
const results = await page.$$('#ui__ac-inner .block')
expect(results.length).toEqual(3) // 2 blocks + 1 page
await page.keyboard.press("Escape")
})