Skip to content

Commit

Permalink
Coverage of ListItems
Browse files Browse the repository at this point in the history
  • Loading branch information
Pezmc committed Nov 14, 2022
1 parent fe18832 commit 24bbcd8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/unit/components/ListItem.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { mount } from '@vue/test-utils'
import ListItem from '@/components/ListItem.vue'

describe('ListItem', () => {
it('renders the passed label', async () => {
const wrapper = mount(ListItem, {
props: {
label: 'my list item'
}
})

expect(wrapper.text()).toMatch('my list item')

await wrapper.setProps({ label: 'new label' })

expect(wrapper.text()).toMatch('new label')
})

it('can be visually disabled', async () => {
const wrapper = mount(ListItem, {
props: {
disabled: true
}
})

expect(wrapper.classes('disabled')).toBe(true)

await wrapper.setProps({ disabled: false })

expect(wrapper.classes('disabled')).toBe(false)
})
})

0 comments on commit 24bbcd8

Please sign in to comment.