fix to use with sveltekit

This commit is contained in:
Thiago Lagden
2023-12-11 13:34:34 -03:00
commit e14f35aff0
29 changed files with 4880 additions and 0 deletions

26
tests/unit/quill.spec.js Normal file
View 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()
})