UNPKG

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

78 lines (70 loc) 2.35 kB
import { mount } from '@vue/test-utils' import { BCardFooter } from './card-footer' describe('card-footer', () => { it('has root element "div"', async () => { const wrapper = mount(BCardFooter) expect(wrapper.is('div')).toBe(true) }) it('has class card-header', async () => { const wrapper = mount(BCardFooter) expect(wrapper.classes()).toContain('card-footer') expect(wrapper.classes().length).toBe(1) }) it('has custom root element when prop footerTag is set', async () => { const wrapper = mount(BCardFooter, { context: { props: { footerTag: 'footer' } } }) expect(wrapper.is('footer')).toBe(true) expect(wrapper.classes()).toContain('card-footer') }) it('has class bg-info when prop footerBgVariant=info', async () => { const wrapper = mount(BCardFooter, { context: { props: { footerBgVariant: 'info' } } }) expect(wrapper.classes()).toContain('card-footer') expect(wrapper.classes()).toContain('bg-info') expect(wrapper.classes().length).toBe(2) }) it('has class text-info when prop footerTextVariant=info', async () => { const wrapper = mount(BCardFooter, { context: { props: { footerTextVariant: 'info' } } }) expect(wrapper.classes()).toContain('card-footer') expect(wrapper.classes()).toContain('text-info') expect(wrapper.classes().length).toBe(2) }) it('has class border-info when prop footerBorderVariant=info', async () => { const wrapper = mount(BCardFooter, { context: { props: { footerBorderVariant: 'info' } } }) expect(wrapper.classes()).toContain('card-footer') expect(wrapper.classes()).toContain('border-info') expect(wrapper.classes().length).toBe(2) }) it('has all variant classes when all variant props set', async () => { const wrapper = mount(BCardFooter, { context: { props: { footerTextVariant: 'info', footerBgVariant: 'danger', footerBorderVariant: 'dark' } } }) expect(wrapper.classes()).toContain('card-footer') expect(wrapper.classes()).toContain('text-info') expect(wrapper.classes()).toContain('bg-danger') expect(wrapper.classes()).toContain('border-dark') expect(wrapper.classes().length).toBe(4) }) })