Skip to content

Instantly share code, notes, and snippets.

@jxc876
Last active December 20, 2018 20:51
Show Gist options
  • Save jxc876/f7a77cd326b41cac74c1ce5550b9fa02 to your computer and use it in GitHub Desktop.
Save jxc876/f7a77cd326b41cac74c1ce5550b9fa02 to your computer and use it in GitHub Desktop.
vue test
// ------------- component (template) ----------------
<v-chip id='example-chip' v-show="showChip">Example Chip</v-chip>
<v-btn color="info" @click="showChip = true">Click Me</v-btn>
// ------------- component (data) ----------------
data: () => ({
showChip: false,
name: "mike"
})
// ------------- component test ----------------
it('should contain show a v-chip after clicking the button', () => {
let chip = wrapper.find('#example-chip');
expect(chip.isVisible()).to.be.false;
wrapper.find('button').trigger('click');
expect(chip.isVisible()).to.be.true;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment