bootstrap-vue
Version:
With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens
49 lines (36 loc) • 1.03 kB
JavaScript
import { mount } from '@vue/test-utils'
import { BCardText } from './card-text'
describe('card-text', () => {
it('has root element "p"', async () => {
const wrapper = mount(BCardText)
expect(wrapper.element.tagName).toBe('P')
wrapper.destroy()
})
it('has class card-text', async () => {
const wrapper = mount(BCardText)
expect(wrapper.classes()).toContain('card-text')
wrapper.destroy()
})
it('has custom root element "div" when prop text-tag=div', async () => {
const wrapper = mount(BCardText, {
context: {
props: {
textTag: 'div'
}
}
})
expect(wrapper.element.tagName).toBe('DIV')
expect(wrapper.classes()).toContain('card-text')
wrapper.destroy()
})
it('accepts custom classes', async () => {
const wrapper = mount(BCardText, {
context: {
class: ['foobar']
}
})
expect(wrapper.classes()).toContain('card-text')
expect(wrapper.classes()).toContain('foobar')
wrapper.destroy()
})
})