@@ -302,50 +302,39 @@ describe('nativeAttributes', () => {
302302 } ) ;
303303} ) ;
304304
305- describe ( 'highlighted ( internal prop) ' , ( ) => {
305+ describe ( 'internal props ' , ( ) => {
306306 function renderInternalItemCard ( jsx : React . ReactElement ) {
307307 const { container } = render ( jsx ) ;
308308 const wrapper = createWrapper ( container ) ;
309309 const itemCard = wrapper . findItemCard ( ) ! ;
310310 return { wrapper, itemCard } ;
311311 }
312312
313- test ( 'applies highlighted class when highlighted is true' , ( ) => {
314- const { itemCard } = renderInternalItemCard ( < InternalItemCard highlighted = { true } > content</ InternalItemCard > ) ;
315- expect ( itemCard . getElement ( ) ) . toHaveClass ( styles . highlighted ) ;
313+ describe ( 'highlighted' , ( ) => {
314+ it . each ( [ true ] ) ( 'applies highlighted class when highlighted=%s' , highlighted => {
315+ const { itemCard } = renderInternalItemCard (
316+ < InternalItemCard highlighted = { highlighted } > content</ InternalItemCard >
317+ ) ;
318+ expect ( itemCard . getElement ( ) ) . toHaveClass ( styles . highlighted ) ;
319+ } ) ;
320+
321+ it . each ( [ false , undefined ] ) ( 'does not apply highlighted class when highlighted=%s' , highlighted => {
322+ const { itemCard } = renderInternalItemCard (
323+ < InternalItemCard highlighted = { highlighted } > content</ InternalItemCard >
324+ ) ;
325+ expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles . highlighted ) ;
326+ } ) ;
316327 } ) ;
317328
318- test ( 'does not apply highlighted class by default' , ( ) => {
319- const { itemCard } = renderInternalItemCard ( < InternalItemCard > content</ InternalItemCard > ) ;
320- expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles . highlighted ) ;
321- } ) ;
322-
323- test ( 'does not apply highlighted class when highlighted is false' , ( ) => {
324- const { itemCard } = renderInternalItemCard ( < InternalItemCard highlighted = { false } > content</ InternalItemCard > ) ;
325- expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles . highlighted ) ;
326- } ) ;
327- } ) ;
328-
329- describe ( 'fullHeight (internal prop)' , ( ) => {
330- function renderInternalItemCard ( jsx : React . ReactElement ) {
331- const { container } = render ( jsx ) ;
332- const wrapper = createWrapper ( container ) ;
333- const itemCard = wrapper . findItemCard ( ) ! ;
334- return { wrapper, itemCard } ;
335- }
336-
337- test ( 'applies full-height class when fullHeight is true' , ( ) => {
338- const { itemCard } = renderInternalItemCard ( < InternalItemCard fullHeight = { true } > content</ InternalItemCard > ) ;
339- expect ( itemCard . getElement ( ) ) . toHaveClass ( styles [ 'full-height' ] ) ;
340- } ) ;
341-
342- test ( 'does not apply full-height class by default' , ( ) => {
343- const { itemCard } = renderInternalItemCard ( < InternalItemCard > content</ InternalItemCard > ) ;
344- expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles [ 'full-height' ] ) ;
345- } ) ;
329+ describe ( 'fullHeight' , ( ) => {
330+ it . each ( [ true ] ) ( 'applies full-height class when fullHeight=%s' , fullHeight => {
331+ const { itemCard } = renderInternalItemCard ( < InternalItemCard fullHeight = { fullHeight } > content</ InternalItemCard > ) ;
332+ expect ( itemCard . getElement ( ) ) . toHaveClass ( styles [ 'full-height' ] ) ;
333+ } ) ;
346334
347- test ( 'does not apply full-height class when fullHeight is false' , ( ) => {
348- const { itemCard } = renderInternalItemCard ( < InternalItemCard fullHeight = { false } > content</ InternalItemCard > ) ;
349- expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles [ 'full-height' ] ) ;
335+ it . each ( [ false , undefined ] ) ( 'does not apply full-height class when fullHeight=%s' , fullHeight => {
336+ const { itemCard } = renderInternalItemCard ( < InternalItemCard fullHeight = { fullHeight } > content</ InternalItemCard > ) ;
337+ expect ( itemCard . getElement ( ) ) . not . toHaveClass ( styles [ 'full-height' ] ) ;
338+ } ) ;
350339 } ) ;
351340} ) ;
0 commit comments