Skip to content

Tests disregard disabled attribute #170

@SergeyKhval

Description

@SergeyKhval

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions