eddyerburgh/avoriaz

Tests disregard disabled attribute

Opened this issue · 3 comments

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)
  })
})

How are you running the tests (what browser/ test runner/ compiler)

I use karma with headless chrome and webpack

I tried to reproduce it with a clean vue-cli installation and it still fails