Update boilerplate tests
This commit is contained in:
Родитель
67dab0f729
Коммит
7c2d5bf237
16
test/test.js
16
test/test.js
|
@ -1,20 +1,20 @@
|
|||
describe('custom-element', function () {
|
||||
describe('typing-effect', function () {
|
||||
describe('element creation', function () {
|
||||
it('creates from document.createElement', function () {
|
||||
const el = document.createElement('custom-element')
|
||||
assert.equal('CUSTOM-ELEMENT', el.nodeName)
|
||||
const el = document.createElement('typing-effect')
|
||||
assert.equal('TYPING-EFFECT', el.nodeName)
|
||||
})
|
||||
|
||||
it('creates from constructor', function () {
|
||||
const el = new window.CustomElementElement()
|
||||
assert.equal('CUSTOM-ELEMENT', el.nodeName)
|
||||
const el = new window.TypingEffectElement()
|
||||
assert.equal('TYPING-EFFECT', el.nodeName)
|
||||
})
|
||||
})
|
||||
|
||||
describe('after tree insertion', function () {
|
||||
beforeEach(function () {
|
||||
document.body.innerHTML = `
|
||||
<custom-element></custom-element>
|
||||
<typing-effect></typing-effect>
|
||||
`
|
||||
})
|
||||
|
||||
|
@ -23,8 +23,8 @@ describe('custom-element', function () {
|
|||
})
|
||||
|
||||
it('initiates', function () {
|
||||
const ce = document.querySelector('custom-element')
|
||||
assert.equal(ce.textContent, ':wave:')
|
||||
const ce = document.querySelector('typing-effect')
|
||||
assert.equal(ce.textContent, '')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче