chore: add tests

This commit is contained in:
Konstantinos Kaloutas
2023-06-08 11:16:41 +03:00
committed by Gabriel Horner
parent a5ca6671d4
commit b1d531f799

View File

@@ -437,3 +437,59 @@ test('go to another board and check reference', async ({ page }) => {
const pageRefCount$ = page.locator('.whiteboard-page-refs-count')
await expect(pageRefCount$.locator('.open-page-ref-link')).toContainText('1')
})
test('Create an embedded whiteboard', async ({ page }) => {
const canvas = await page.waitForSelector('.logseq-tldraw')
await canvas.dblclick({
position: {
x: 150,
y: 150,
},
})
const quickAdd$ = page.locator('.tl-quick-search')
await expect(quickAdd$).toBeVisible()
await page.fill('.tl-quick-search input', 'My embedded whiteboard')
await quickAdd$
.locator('div[data-index="2"] .tl-quick-search-option')
.first()
.click()
await expect(quickAdd$).toBeHidden()
await expect(page.locator('.tl-logseq-portal-header a')).toContainText('My embedded whiteboard')
})
test('New whiteboard should have the correct name', async ({ page }) => {
page.locator('.tl-logseq-portal-header a').click()
await expect(page.locator('.whiteboard-page-title')).toContainText('My embedded whiteboard')
})
test('Create an embedded page', async ({ page }) => {
const canvas = await page.waitForSelector('.logseq-tldraw')
await canvas.dblclick({
position: {
x: 150,
y: 150,
},
})
const quickAdd$ = page.locator('.tl-quick-search')
await expect(quickAdd$).toBeVisible()
await page.fill('.tl-quick-search input', 'My page')
await quickAdd$
.locator('div[data-index="1"] .tl-quick-search-option')
.first()
.click()
await expect(quickAdd$).toBeHidden()
await expect(page.locator('.tl-logseq-portal-header a')).toContainText('My page')
})
test('New page should have the correct name', async ({ page }) => {
page.locator('.tl-logseq-portal-header a').click()
await expect(page.locator('.ls-page-title')).toContainText('My page')
})