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 {
7070 },
7171 computedIcon () {
7272 if (typeof this .icon === ' object' ) {
73+ const key = this .icon .size ? ' class' : ' customClasses'
7374 return Object .assign (
74- { customClasses : ' c-sidebar-nav-icon' },
75+ { [ ` ${ key } ` ] : ' c-sidebar-nav-icon' },
7576 this .icon
7677 )
7778 } else {
Original file line number Diff line number Diff line change @@ -43,4 +43,10 @@ describe(`${ComponentName}.vue`, () => {
4343 it ( 'renders correctly in label mode' , ( ) => {
4444 expect ( wrapperLabel . element ) . toMatchSnapshot ( )
4545 } )
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+ } )
4652} )
You can’t perform that action at this time.
0 commit comments