Skip to content

Commit 899dc49

Browse files
committed
Add: Checkbox and Radio spec for attrs
1 parent 76a4eb6 commit 899dc49

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/unit/Checkbox.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ describe('Checkbox.vue', () => {
2828
})
2929
expect(wrapper.find('.vue-checkbox__label span').text()).toBe('label')
3030
})
31+
it('attributes is rendered', () => {
32+
const wrapper = shallowMount(Checkbox)
33+
wrapper.setProps({ name: 'text', disabled: true })
34+
const attrs = wrapper.find('input').attributes()
35+
expect(attrs.name).toContain('text')
36+
expect(attrs.disabled).toContain('disabled')
37+
})
3138
it('is checked', () => {
3239
const wrapper = mount({
3340
template: `<vue-checkbox v-model="check"></vue-checkbox>`,

tests/unit/Radio.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ describe('Radio.vue', () => {
3737
})
3838
expect(wrapper.find('.vue-radio--disabled').exists()).toBe(true)
3939
})
40+
it('attributes is rendered', () => {
41+
const wrapper = shallowMount(Radio)
42+
wrapper.setProps({ name: 'text', disabled: true })
43+
const attrs = wrapper.find('input').attributes()
44+
expect(attrs.name).toContain('text')
45+
expect(attrs.disabled).toContain('disabled')
46+
})
4047
it('is checked', () => {
4148
const wrapper = mount({
4249
template: '<vue-radio v-model="radio" value="1"></vue-radio>',

0 commit comments

Comments
 (0)