Skip to content

Commit d734a57

Browse files
committed
test(#1): variants defined as an array
1 parent c875263 commit d734a57

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

__tests__/index.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useVariant } from '~/lib/index.es'
33
describe('vue-use-variant', () => {
44
const variantsDefinitions = {
55
button: 'button-class',
6-
buttonPrimary: 'button-class-primary'
6+
buttonPrimary: 'button-class-primary',
77
}
88

99
it('Renders class string with regular configuration', () => {
@@ -30,10 +30,10 @@ describe('vue-use-variant', () => {
3030
{
3131
value: {
3232
button: true,
33-
buttonPrimary: true
34-
}
33+
buttonPrimary: true,
34+
},
3535
},
36-
variantsDefinitions
36+
variantsDefinitions,
3737
)
3838
// @ts-ignore
3939
expect(variants).toBe('button-class button-class-primary')
@@ -48,6 +48,12 @@ describe('vue-use-variant', () => {
4848
// @ts-ignore
4949
expect(variants).toBe('button-class button-class-primary')
5050
})
51+
it('Renders class string with an array', () => {
52+
const { defineVariant } = useVariant()
53+
const variants = defineVariant(['button', 'buttonPrimary'], variantsDefinitions)
54+
// @ts-ignore
55+
expect(variants).toBe('button-class button-class-primary')
56+
})
5157
it('Fails when using wrong variants data', () => {
5258
// @ts-ignore
5359
global.console = { warn: jest.fn() }

0 commit comments

Comments
 (0)