2022-05-11 07:59:26 +00:00
|
|
|
import { expect, it } from 'vitest'
|
2022-05-13 17:58:38 +00:00
|
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
2022-05-11 07:59:26 +00:00
|
|
|
import BtnGroup from './BtnGroup.vue'
|
|
|
|
import Btn from './Btn.vue'
|
|
|
|
|
2022-05-13 17:58:38 +00:00
|
|
|
new class extends UnitTestCase {
|
2022-05-11 07:59:26 +00:00
|
|
|
private renderButtonToSlot (text: string) {
|
|
|
|
return this.render(Btn, {
|
|
|
|
slots: {
|
|
|
|
default: text
|
|
|
|
}
|
|
|
|
}).html()
|
|
|
|
}
|
|
|
|
|
|
|
|
protected test () {
|
|
|
|
it('renders', () => {
|
|
|
|
expect(this.render(BtnGroup, {
|
|
|
|
slots: {
|
|
|
|
default: ['Green', 'Orange', 'Blue'].map(text => this.renderButtonToSlot(text))
|
|
|
|
}
|
|
|
|
}).html()).toMatchSnapshot()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|