File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useVariant } from '~/lib/index.es'
33describe ( '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 ( ) }
You can’t perform that action at this time.
0 commit comments