UNPKG

bootstrap-vue

Version:

BootstrapVue, with over 40 plugins and more than 80 custom components, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-ARIA accessibility markup.

40 lines (33 loc) 1.06 kB
import { mount } from '@vue/test-utils' import { BFormRow } from './form-row' describe('layout > form-row', () => { it('has expected default structure', async () => { const wrapper = mount(BFormRow) expect(wrapper.is('div')).toBe(true) expect(wrapper.classes()).toContain('form-row') expect(wrapper.classes().length).toBe(1) expect(wrapper.text()).toEqual('') }) it('custom root element when prop tag set', async () => { const wrapper = mount(BFormRow, { propsData: { tag: 'span' } }) expect(wrapper.is('span')).toBe(true) expect(wrapper.classes()).toContain('form-row') expect(wrapper.classes().length).toBe(1) expect(wrapper.text()).toEqual('') }) it('renders default slot content', async () => { const wrapper = mount(BFormRow, { slots: { default: 'foobar' } }) expect(wrapper.is('div')).toBe(true) expect(wrapper.classes()).toContain('form-row') expect(wrapper.classes().length).toBe(1) expect(wrapper.text()).toEqual('foobar') }) })