10000 Update form-tags.spec.js · bootstrap-vue/bootstrap-vue@7261135 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7261135

Browse files
committed
Update form-tags.spec.js
1 parent 09b7280 commit 7261135

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/form-tags/form-tags.spec.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,21 @@ describe('form-tags', () => {
100100
it('has hidden inputs when name is set', async () => {
101101
const wrapper = mount(BFormTags, {
102102
propsData: {
103-
value: ['apple', 'orange'],
104-
name: 'foo'
103+
value: [],
104+
name: 'foo',
105+
required: true
105106
}
106107
})
107108

108109
expect(wrapper.element.tagName).toBe('DIV')
109110

110-
const $hidden = wrapper.findAll('input[type=hidden]')
111+
let $hidden = wrapper.find('input.sr-only')
112+
expect($hidden.attributes('value')).toEqual('')
113+
expect($hidden.attributes('name')).toEqual('foo')
114+
expect($hidden.attributes('required')).toBeDefined()
115+
116+
await wrapper.setProps({ value: ['apple', 'orange'] })
117+
$hidden = wrapper.findAll('input[type=hidden]')
111118
expect($hidden.length).toBe(2)
112119
expect($hidden.at(0).attributes('value')).toEqual('apple')
113120
expect($hidden.at(0).attributes('name')).toEqual('foo')

0 commit comments

Comments
 (0)
0