bootstrap-vue
Version:
BootstrapVue, with over 40 plugins and more than 80 custom components, custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-AR
34 lines (27 loc) • 915 B
JavaScript
import { mount } from '@vue/test-utils'
import { BDropdownText } from './dropdown-text'
describe('dropdown-text', () => {
it('renders with tag "p" by default', async () => {
const wrapper = mount(BDropdownText)
expect(wrapper.is('li')).toBe(true)
const text = wrapper.find('p')
expect(text.is('p')).toBe(true)
})
it('has custom class "b-dropdown-text"', async () => {
const wrapper = mount(BDropdownText)
expect(wrapper.is('li')).toBe(true)
const text = wrapper.find('p')
expect(text.classes()).toContain('b-dropdown-text')
})
it('renders with tag "div" when tag=div', async () => {
const wrapper = mount(BDropdownText, {
context: {
props: { tag: 'div' }
}
})
expect(wrapper.is('li')).toBe(true)
const text = wrapper.find('div')
expect(text.is('div')).toBe(true)
expect(text.classes()).toContain('b-dropdown-text')
})
})