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

25 lines
578 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 {
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()
})
}
}