koel/resources/assets/js/components/ui/form/BtnGroup.spec.ts

25 lines
582 B
TypeScript
Raw Normal View History

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