fix to use with sveltekit
This commit is contained in:
BIN
tests/e2e/__snapshots__/index.spec.js.png
Normal file
BIN
tests/e2e/__snapshots__/index.spec.js.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
15
tests/e2e/index.spec.js
Normal file
15
tests/e2e/index.spec.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import {setTimeout} from 'node:timers/promises'
|
||||
import {
|
||||
// expect,
|
||||
test,
|
||||
} from '@playwright/test'
|
||||
|
||||
test('general', async ({page}) => {
|
||||
await page.goto('/')
|
||||
|
||||
await setTimeout(1000)
|
||||
|
||||
await page.screenshot({
|
||||
path: './tests/e2e/__snapshots__/index.spec.js.png',
|
||||
})
|
||||
})
|
||||
26
tests/unit/quill.spec.js
Normal file
26
tests/unit/quill.spec.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import {setTimeout} from 'timers/promises'
|
||||
import {test, expect, beforeAll} from 'vitest'
|
||||
import {Editor} from '$lib/index.js'
|
||||
|
||||
beforeAll(() => {
|
||||
document.body.innerHTML = '<main id="xxx"></main>'
|
||||
})
|
||||
|
||||
function doc_query(selector) {
|
||||
const node = document.querySelector(selector)
|
||||
if (!node) {
|
||||
throw new Error(`No element found for selector: ${selector}`)
|
||||
}
|
||||
return node
|
||||
}
|
||||
|
||||
test('Editor', async () => {
|
||||
const target = doc_query('main#xxx')
|
||||
// const component = new Editor({target})
|
||||
new Editor({target})
|
||||
|
||||
await setTimeout(3000)
|
||||
|
||||
// const div = doc_query('div.ql-editor')
|
||||
expect(target).toBeDefined()
|
||||
})
|
||||
Reference in New Issue
Block a user