Tests disregard disabled attribute
Opened this issue · 3 comments
SergeyKhval commented
The following test fails
<template>
<button disabled @click="handleClick">Button</button>
</template>
<script>
export default {
methods: {
handleClick() {
console.log('clicked')
},
},
}
</script>
import { shallow } from 'avoriaz'
import { stub } from 'sinon'
import Test from './test'
describe('TEST COMPONENT', () => {
it('should not handle click', () => {
const wrapper = shallow(Test)
wrapper.vm.handleClick = stub()
wrapper.update()
wrapper.first('button').trigger('click')
expect(wrapper.vm.handleClick.called).to.equal(false)
})
})
eddyerburgh commented
How are you running the tests (what browser/ test runner/ compiler)
SergeyKhval commented
I use karma with headless chrome and webpack
SergeyKhval commented
I tried to reproduce it with a clean vue-cli installation and it still fails