Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests disregard disabled attribute #170

Open
SergeyKhval opened this issue Dec 13, 2017 · 3 comments
Open

Tests disregard disabled attribute #170

SergeyKhval opened this issue Dec 13, 2017 · 3 comments

Comments

@SergeyKhval
Copy link

SergeyKhval commented Dec 13, 2017

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
Copy link
Owner

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

@SergeyKhval
Copy link
Author

I use karma with headless chrome and webpack

@SergeyKhval
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants