![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/bootstrap-vue/src/components/form/ |
import { mount } from '@vue/test-utils' import { BFormDatalist } from './form-datalist' describe('form-datalist', () => { it('has root element datalist', async () => { const wrapper = mount(BFormDatalist, { propsData: { id: 'test-list' } }) expect(wrapper.element.tagName).toBe('DATALIST') wrapper.destroy() }) it('has user supplied ID', async () => { const wrapper = mount(BFormDatalist, { propsData: { id: 'test-list' } }) expect(wrapper.attributes('id')).toBe('test-list') wrapper.destroy() }) it('has no option elements by default', async () => { const wrapper = mount(BFormDatalist, { propsData: { id: 'test-list' } }) expect(wrapper.findAll('option').length).toBe(0) wrapper.destroy() }) it('has options when options set', async () => { const wrapper = mount(BFormDatalist, { propsData: { id: 'test-list', options: ['one', 'two'] } }) const $options = wrapper.findAll('option') expect($options.length).toBe(2) expect($options.at(0).text()).toBe('one') expect($options.at(1).text()).toBe('two') expect($options.at(0).attributes('value')).toBe('one') expect($options.at(1).attributes('value')).toBe('two') wrapper.destroy() }) })