StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/bootstrap-vue/src/components/card/card-body.spec.js

112 lines
3.1 KiB

import { mount } from '@vue/test-utils'
import { BCardBody } from './card-body'
describe('card-body', () => {
it('has root element "div"', async () => {
const wrapper = mount(BCardBody)
expect(wrapper.is('div')).toBe(true)
})
it('has class card-body', async () => {
const wrapper = mount(BCardBody)
expect(wrapper.classes()).toContain('card-body')
expect(wrapper.classes().length).toBe(1)
})
it('has custom root element when prop bodyTag is set', async () => {
const wrapper = mount(BCardBody, {
context: {
props: {
bodyTag: 'article'
}
}
})
expect(wrapper.is('article')).toBe(true)
expect(wrapper.classes()).toContain('card-body')
})
it('has class bg-info when prop bodyBgVariant=info', async () => {
const wrapper = mount(BCardBody, {
context: {
props: { bodyBgVariant: 'info' }
}
})
expect(wrapper.classes()).toContain('card-body')
expect(wrapper.classes()).toContain('bg-info')
expect(wrapper.classes().length).toBe(2)
})
it('has class text-info when prop bodyTextVariant=info', async () => {
const wrapper = mount(BCardBody, {
context: {
props: { bodyTextVariant: 'info' }
}
})
expect(wrapper.classes()).toContain('card-body')
expect(wrapper.classes()).toContain('text-info')
expect(wrapper.classes().length).toBe(2)
})
it('has class border-info when prop bodyBorderVariant=info', async () => {
const wrapper = mount(BCardBody, {
context: {
props: { bodyBorderVariant: 'info' }
}
})
expect(wrapper.classes()).toContain('card-body')
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(BCardBody, {
context: {
props: {
bodyTextVariant: 'info',
bodyBgVariant: 'danger',
bodyBorderVariant: 'dark'
}
}
})
expect(wrapper.classes()).toContain('card-body')
expect(wrapper.classes()).toContain('text-info')
expect(wrapper.classes()).toContain('bg-danger')
expect(wrapper.classes()).toContain('border-dark')
expect(wrapper.classes().length).toBe(4)
})
it('has class "card-img-overlay" when overlay="true"', async () => {
const wrapper = mount(BCardBody, {
context: {
props: {
overlay: true
}
}
})
expect(wrapper.classes()).toContain('card-body')
expect(wrapper.classes()).toContain('card-img-overlay')
expect(wrapper.classes().length).toBe(2)
})
it('has card-title when title prop is set', async () => {
const wrapper = mount(BCardBody, {
context: {
props: {
title: 'title'
}
}
})
expect(wrapper.find('div.card-title')).toBeDefined()
})
it('has card-sub-title when sub-title prop is set', async () => {
const wrapper = mount(BCardBody, {
context: {
props: {
subTitle: 'sub title'
}
}
})
expect(wrapper.find('div.card-subtitle')).toBeDefined()
})
})