提交 f2eb3989 编写于 作者: D dolymood

test(input): focus & blur api

上级 d4856f24
......@@ -148,12 +148,12 @@ describe('Input.vue', () => {
}
})
const input = vm.$el.querySelector('input')
input.focus()
vm.focus()
setTimeout(() => {
expect(focusHandler)
.to.be.calledOnce
input.value = 'new value'
input.blur()
vm.blur()
const e = createEvent('', 'change')
input.dispatchEvent(e)
setTimeout(() => {
......
......@@ -40,12 +40,12 @@ describe('Textarea.vue', () => {
})
it('should expand when focus, fold when blur', (done) => {
vm = createTextarea(1)
vm.$el.querySelector('textarea').focus()
vm.focus()
setTimeout(() => {
expect(vm.$el.offsetHeight)
.to.equal(80)
vm.textareaValue = ''
vm.$el.querySelector('textarea').blur()
vm.blur()
setTimeout(() => {
expect(vm.$el.offsetHeight)
.to.equal(40)
......@@ -55,7 +55,7 @@ describe('Textarea.vue', () => {
})
it('should has remain when focus', (done) => {
vm = createTextarea(1)
vm.$el.querySelector('textarea').focus()
vm.focus()
setTimeout(() => {
expect(vm.$el.querySelector('.cube-textarea-indicator').innerText)
.to.equal('56')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册