Skip to content

Instantly share code, notes, and snippets.

@morphatic
Created September 11, 2019 00:14
Show Gist options
  • Save morphatic/ee43f52c71064a34282ee7d01a79c4ec to your computer and use it in GitHub Desktop.
Save morphatic/ee43f52c71064a34282ee7d01a79c4ec to your computer and use it in GitHub Desktop.
Tests for custom properties of VStateSelect
it('should render component and match snapshot', () => {
const wrapper = mountFunction()
// replace the auto-generated `id` with one that matches
const html = wrapper.html().replace(/div id="input-\d+"/, 'div id="input-1"')
expect(html).toMatchSnapshot()
})
it('should have a property called `contiguousOnly` that defaults to `false`', () => {
const wrapper = mountFunction()
expect(wrapper.vm.contiguousOnly).toBeDefined()
expect(wrapper.vm.contiguousOnly).toBe(false)
})
it('should have a property called `exclude` that defaults to an empty array', () => {
const wrapper = mountFunction()
expect(wrapper.vm.exclude).toBeDefined()
expect(wrapper.vm.exclude).toStrictEqual([])
})
it('should have a property called `includeTerritories` that defaults to `false`', () => {
const wrapper = mountFunction()
expect(wrapper.vm.includeTerritories).toBeDefined()
expect(wrapper.vm.includeTerritories).toBe(false)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment