11import assert from 'power-assert' ;
22import React from 'react' ;
3- import { shallow } from 'enzyme' ;
3+ import { mount } from 'enzyme' ;
44
55import { Icon } from '../src/scripts/Icon' ;
66
77describe ( 'Icon' , ( ) => {
88 it ( 'should render icon' , ( ) => {
99 const icon = 'check' ;
10- const wrapper = shallow ( < Icon icon = { icon } /> ) ;
11- assert ( wrapper . hasClass ( ' slds-icon') ) ;
10+ const wrapper = mount ( < Icon icon = { icon } /> ) ;
11+ assert ( wrapper . exists ( '. slds-icon') ) ;
1212 assert (
1313 wrapper
1414 . html ( )
@@ -18,14 +18,14 @@ describe('Icon', () => {
1818
1919 it ( 'should render icon with size' , ( ) => {
2020 const size = 'small' ;
21- const wrapper = shallow ( < Icon icon = 'icon' size = { size } /> ) ;
22- assert ( wrapper . hasClass ( ` slds-icon_${ size } `) ) ;
21+ const wrapper = mount ( < Icon icon = 'icon' size = { size } /> ) ;
22+ assert ( wrapper . exists ( `. slds-icon_${ size } `) ) ;
2323 } ) ;
2424
2525 it ( 'should render icon with category' , ( ) => {
2626 const category = 'standard' ;
2727 const icon = 'account' ;
28- const wrapper = shallow ( < Icon category = { category } icon = { icon } /> ) ;
28+ const wrapper = mount ( < Icon category = { category } icon = { icon } /> ) ;
2929 assert (
3030 wrapper
3131 . html ( )
@@ -37,7 +37,7 @@ describe('Icon', () => {
3737 const category = 'action' ;
3838 const icon = 'add_contact' ;
3939 const categoryIcon = `${ category } :${ icon } ` ;
40- const wrapper = shallow ( < Icon icon = { categoryIcon } /> ) ;
40+ const wrapper = mount ( < Icon icon = { categoryIcon } /> ) ;
4141 assert (
4242 wrapper
4343 . html ( )
0 commit comments