File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ export default {
70
70
},
71
71
computedIcon () {
72
72
if (typeof this .icon === ' object' ) {
73
+ const key = this .icon .size ? ' class' : ' customClasses'
73
74
return Object .assign (
74
- { customClasses : ' c-sidebar-nav-icon' },
75
+ { [ ` ${ key } ` ] : ' c-sidebar-nav-icon' },
75
76
this .icon
76
77
)
77
78
} else {
Original file line number Diff line number Diff line change @@ -43,4 +43,10 @@ describe(`${ComponentName}.vue`, () => {
43
43
it ( 'renders correctly in label mode' , ( ) => {
44
44
expect ( wrapperLabel . element ) . toMatchSnapshot ( )
45
45
} )
46
+ it ( 'assign correct classes in case of custom icon size' , ( ) => {
47
+ wrapperLabel . setProps ( { icon : { name : 'cui-settings' , size : 'lg' } } )
48
+ expect ( wrapperLabel . find ( 'svg' ) . classes ( ) . join ( ',' ) ) . toBe (
49
+ 'c-icon,c-icon-lg,c-sidebar-nav-icon'
50
+ )
51
+ } )
46
52
} )
You can’t perform that action at this time.
0 commit comments