|
@@ -1,6 +1,6 @@
|
|
import { expect } from '@playwright/test'
|
|
import { expect } from '@playwright/test'
|
|
import { test } from './fixtures'
|
|
import { test } from './fixtures'
|
|
-import { IsMac, createRandomPage, newBlock, newInnerBlock, randomString, lastInnerBlock } from './utils'
|
|
|
|
|
|
+import { IsMac, createRandomPage, newBlock, newInnerBlock, randomString, lastInnerBlock, activateNewPage } from './utils'
|
|
|
|
|
|
/***
|
|
/***
|
|
* Test alias features
|
|
* Test alias features
|
|
@@ -8,6 +8,41 @@ import { IsMac, createRandomPage, newBlock, newInnerBlock, randomString, lastInn
|
|
* Consider diacritics
|
|
* Consider diacritics
|
|
***/
|
|
***/
|
|
|
|
|
|
|
|
+ test('Search 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")
|
|
|
|
+})
|
|
|
|
+
|
|
async function alias_test(page, page_name: string, search_kws: string[]) {
|
|
async function alias_test(page, page_name: string, search_kws: string[]) {
|
|
let hotkeyOpenLink = 'Control+o'
|
|
let hotkeyOpenLink = 'Control+o'
|
|
let hotkeyBack = 'Control+['
|
|
let hotkeyBack = 'Control+['
|
|
@@ -111,11 +146,6 @@ async function alias_test(page, page_name: string, search_kws: string[]) {
|
|
// TODO: search clicking (alias property)
|
|
// TODO: search clicking (alias property)
|
|
}
|
|
}
|
|
|
|
|
|
-// test('page alias', async ({ page }) => {
|
|
|
|
-// await alias_test(page, "p")
|
|
|
|
-// })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
test('page diacritic alias', async ({ page }) => {
|
|
test('page diacritic alias', async ({ page }) => {
|
|
await alias_test(page, "ü", ["ü", "ü", "Ü"])
|
|
await alias_test(page, "ü", ["ü", "ü", "Ü"])
|
|
})
|
|
})
|