Add test for specifying delay attributes
This commit is contained in:
Родитель
7476b94ce4
Коммит
6600872805
13
test/test.js
13
test/test.js
|
@ -75,6 +75,19 @@ describe('typing-effect', function () {
|
|||
assert.equal(typingEffectElement.characterDelay, 40)
|
||||
assert.equal(typingEffectElement.lineDelay, 40)
|
||||
})
|
||||
|
||||
it('uses specified delay attributes instead of using defaults', function () {
|
||||
const characterDelay = 20
|
||||
const lineDelay = 20
|
||||
document.body.innerHTML = `
|
||||
<typing-effect data-character-delay="${characterDelay}" data-line-delay="${lineDelay}">
|
||||
</typing-effect>
|
||||
`
|
||||
const typingEffectElement = document.querySelector('typing-effect')
|
||||
|
||||
assert.equal(typingEffectElement.characterDelay, characterDelay)
|
||||
assert.equal(typingEffectElement.lineDelay, lineDelay)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче