@@ -3,20 +3,12 @@ import { render } from '@testing-library/react'
33import '@testing-library/jest-dom/extend-expect'
44import CIcon from './../'
55
6- // import { cifAu } from './../../../icons/js/flag/cif-au'
7-
86describe ( 'CIcon' , ( ) => {
97 it ( 'renders svg with class="icon"' , ( ) => {
108 const { container } = render ( < CIcon /> )
119 expect ( container . firstChild ) . toHaveClass ( 'icon' )
1210 } )
1311
14- // it('renders svg with icon', () => {
15- // const { container } = render(<CIcon icon={cifAu} />)
16- // expect(container.firstChild).toContain(cifAu[1])
17- // // expect(render()).toContain(cifAu)
18- // })
19-
2012 it ( 'renders svg with size' , ( ) => {
2113 const { container } = render ( < CIcon size = "xl" /> )
2214 expect ( container . firstChild ) . toHaveClass ( 'icon-xl' )
@@ -32,8 +24,8 @@ describe('CIcon', () => {
3224 expect ( container . firstChild ) . toHaveClass ( 'icon-test' )
3325 } )
3426
35- // it('renders < svg> with <use> ', () => {
36- // const { container } = render(<CIcon use="xxx " />)
37- // expect(container.firstChild?.firstChild).toContain('<use href="xxx" /> ')
38- // })
27+ it ( 'renders svg with custom className ' , ( ) => {
28+ const { container } = render ( < CIcon customClassName = "icon-custom-test " /> )
29+ expect ( container . firstChild ) . toHaveClass ( 'icon-custom-test ')
30+ } )
3931} )
0 commit comments