11import React from 'react'
22import Tooltip from '../Tooltip'
3- import { render , renderClasses } from '../utils/testing'
3+ import { render , renderClasses , rendersClass } from '../utils/testing'
44
55describe ( 'Tooltip' , ( ) => {
66 it ( 'renders a <span> with the "tooltipped" class' , ( ) => {
@@ -9,27 +9,27 @@ describe('Tooltip', () => {
99 } )
1010
1111 it ( 'respects the "align" prop' , ( ) => {
12- expect ( renderClasses ( < Tooltip align = "ne" /> ) . includes ( 'tooltipped-align-ne-2' ) ) . toBe ( true )
13- expect ( renderClasses ( < Tooltip align = "se" /> ) . includes ( 'tooltipped-align-se-2' ) ) . toBe ( true )
14- expect ( renderClasses ( < Tooltip align = "nw" /> ) . includes ( 'tooltipped-align-nw-2' ) ) . toBe ( true )
15- expect ( renderClasses ( < Tooltip align = "sw" /> ) . includes ( 'tooltipped-align-sw-2' ) ) . toBe ( true )
12+ expect ( rendersClass ( < Tooltip align = "ne" /> , 'tooltipped-align-ne-2' ) ) . toBe ( true )
13+ expect ( rendersClass ( < Tooltip align = "se" /> , 'tooltipped-align-se-2' ) ) . toBe ( true )
14+ expect ( rendersClass ( < Tooltip align = "nw" /> , 'tooltipped-align-nw-2' ) ) . toBe ( true )
15+ expect ( rendersClass ( < Tooltip align = "sw" /> , 'tooltipped-align-sw-2' ) ) . toBe ( true )
1616 } )
1717
1818 it ( 'respects the "direction" prop' , ( ) => {
1919 for ( const direction of Tooltip . directions ) {
20- expect ( renderClasses ( < Tooltip direction = { direction } /> ) . includes ( `tooltipped-${ direction } ` ) ) . toBe ( true )
20+ expect ( rendersClass ( < Tooltip direction = { direction } /> , `tooltipped-${ direction } ` ) ) . toBe ( true )
2121 }
2222 } )
2323
2424 it ( 'respects the "noDelay" prop' , ( ) => {
25- expect ( renderClasses ( < Tooltip noDelay /> ) . includes ( ` tooltipped-no-delay` ) ) . toBe ( true )
25+ expect ( rendersClass ( < Tooltip noDelay /> , ' tooltipped-no-delay' ) ) . toBe ( true )
2626 } )
2727
2828 it ( 'respects the "text" prop' , ( ) => {
2929 expect ( render ( < Tooltip text = "hi" /> ) . props [ 'aria-label' ] ) . toEqual ( 'hi' )
3030 } )
3131
3232 it ( 'respects the "wrap" prop' , ( ) => {
33- expect ( renderClasses ( < Tooltip wrap /> ) . includes ( 'tooltipped-multiline' ) ) . toBe ( true )
33+ expect ( rendersClass ( < Tooltip wrap /> , 'tooltipped-multiline' ) ) . toBe ( true )
3434 } )
3535} )
0 commit comments