33 react/prefer-stateless-function, react/no-multi-comp
44*/
55import { act , fireEvent , render } from '@testing-library/react' ;
6- import classNames from 'classnames ' ;
6+ import { clsx } from 'clsx ' ;
77import React from 'react' ;
88import ReactDOM from 'react-dom' ;
99import type { CSSMotionProps } from '../src' ;
@@ -94,7 +94,7 @@ describe('CSSMotion', () => {
9494 return (
9595 < div
9696 style = { style }
97- className = { classNames ( 'motion-box' , className ) }
97+ className = { clsx ( 'motion-box' , className ) }
9898 />
9999 ) ;
100100 } }
@@ -173,10 +173,7 @@ describe('CSSMotion', () => {
173173 >
174174 { ( { style, className } ) => {
175175 return (
176- < div
177- style = { style }
178- className = { classNames ( 'motion-box' , className ) }
179- />
176+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
180177 ) ;
181178 } }
182179 </ CSSMotion >
@@ -219,10 +216,7 @@ describe('CSSMotion', () => {
219216 const genMotion = ( props ?: CSSMotionProps ) => (
220217 < CSSMotion motionName = "transition" visible { ...props } >
221218 { ( { style, className } ) => (
222- < div
223- style = { style }
224- className = { classNames ( 'motion-box' , className ) }
225- />
219+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
226220 ) }
227221 </ CSSMotion >
228222 ) ;
@@ -248,10 +242,7 @@ describe('CSSMotion', () => {
248242 const genMotion = ( props ?: CSSMotionProps ) => (
249243 < CSSMotion motionName = "transition" { ...props } >
250244 { ( { style, className } ) => (
251- < div
252- style = { style }
253- className = { classNames ( 'motion-box' , className ) }
254- />
245+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
255246 ) }
256247 </ CSSMotion >
257248 ) ;
@@ -307,7 +298,7 @@ describe('CSSMotion', () => {
307298 < Component
308299 ref = { ref }
309300 style = { style }
310- className = { classNames ( 'motion-box' , className ) }
301+ className = { clsx ( 'motion-box' , className ) }
311302 />
312303 ) }
313304 </ CSSMotion > ,
@@ -362,10 +353,7 @@ describe('CSSMotion', () => {
362353 motionLeave = { true }
363354 >
364355 { ( { style, className } ) => (
365- < div
366- style = { style }
367- className = { classNames ( 'motion-box' , className ) }
368- />
356+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
369357 ) }
370358 </ CSSMotion >
371359 </ React . StrictMode >
@@ -440,10 +428,7 @@ describe('CSSMotion', () => {
440428 { ...props }
441429 >
442430 { ( { style, className } ) => (
443- < div
444- style = { style }
445- className = { classNames ( 'motion-box' , className ) }
446- />
431+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
447432 ) }
448433 </ CSSMotion >
449434 ) ;
@@ -481,7 +466,7 @@ describe('CSSMotion', () => {
481466 const genMotion = ( props ?: CSSMotionProps ) => (
482467 < CSSMotion visible { ...props } >
483468 { ( { style, className } ) => (
484- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
469+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
485470 ) }
486471 </ CSSMotion >
487472 ) ;
@@ -513,10 +498,7 @@ describe('CSSMotion', () => {
513498 visible = { false }
514499 >
515500 { ( { style, className } ) => (
516- < div
517- style = { style }
518- className = { classNames ( 'motion-box' , className ) }
519- />
501+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
520502 ) }
521503 </ CSSMotion > ,
522504 ) ;
@@ -547,7 +529,7 @@ describe('CSSMotion', () => {
547529 onAppearPrepare = { ( ) => new Promise ( ( ) => { } ) }
548530 >
549531 { ( { style, className } ) => (
550- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
532+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
551533 ) }
552534 </ CSSMotion > ,
553535 ) ;
@@ -584,10 +566,7 @@ describe('CSSMotion', () => {
584566 onAppearStart = { onAppearStart }
585567 >
586568 { ( { style, className } ) => (
587- < div
588- style = { style }
589- className = { classNames ( 'motion-box' , className ) }
590- />
569+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
591570 ) }
592571 </ CSSMotion >
593572 </ Provider >
@@ -617,7 +596,7 @@ describe('CSSMotion', () => {
617596 const { container } = render (
618597 < NoCSSTransition motionName = "transition" >
619598 { ( { style, className } ) => (
620- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
599+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
621600 ) }
622601 </ NoCSSTransition > ,
623602 ) ;
@@ -636,7 +615,7 @@ describe('CSSMotion', () => {
636615 < div
637616 ref = { ref }
638617 style = { style }
639- className = { classNames ( 'motion-box' , className ) }
618+ className = { clsx ( 'motion-box' , className ) }
640619 />
641620 ) }
642621 </ RefCSSMotion > ,
@@ -704,10 +683,7 @@ describe('CSSMotion', () => {
704683 motionName = "bamboo"
705684 >
706685 { ( { style, className } ) => (
707- < Component
708- style = { style }
709- className = { classNames ( 'motion-box' , className ) }
710- />
686+ < Component style = { style } className = { clsx ( 'motion-box' , className ) } />
711687 ) }
712688 </ CSSMotion >
713689 ) ;
@@ -747,7 +723,7 @@ describe('CSSMotion', () => {
747723 const { container } = render (
748724 < CSSMotion visible motionName = "bamboo" onAppearPrepare = { onAppearPrepare } >
749725 { ( { style, className } ) => (
750- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
726+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
751727 ) }
752728 </ CSSMotion > ,
753729 ) ;
@@ -780,7 +756,7 @@ describe('CSSMotion', () => {
780756 const genMotion = ( props ?: CSSMotionProps ) => (
781757 < CSSMotion forceRender motionName = "bamboo" visible = { false } { ...props } >
782758 { ( { style, className } ) => (
783- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
759+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
784760 ) }
785761 </ CSSMotion >
786762 ) ;
@@ -806,7 +782,7 @@ describe('CSSMotion', () => {
806782 { ...props }
807783 >
808784 { ( { style, className } ) => (
809- < div style = { style } className = { classNames ( 'motion-box' , className ) } />
785+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
810786 ) }
811787 </ CSSMotion >
812788 ) ;
@@ -938,10 +914,7 @@ describe('CSSMotion', () => {
938914 onVisibleChanged = { onVisibleChanged }
939915 >
940916 { ( { style, className } ) => (
941- < div
942- style = { style }
943- className = { classNames ( 'motion-box' , className ) }
944- />
917+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
945918 ) }
946919 </ CSSMotion > ,
947920 ) ;
@@ -964,10 +937,7 @@ describe('CSSMotion', () => {
964937 onVisibleChanged = { onVisibleChanged }
965938 >
966939 { ( { style, className } ) => (
967- < div
968- style = { style }
969- className = { classNames ( 'motion-box' , className ) }
970- />
940+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
971941 ) }
972942 </ CSSMotion > ,
973943 ) ;
@@ -990,10 +960,7 @@ describe('CSSMotion', () => {
990960 onVisibleChanged = { onVisibleChanged }
991961 >
992962 { ( { style, className } ) => (
993- < div
994- style = { style }
995- className = { classNames ( 'motion-box' , className ) }
996- />
963+ < div style = { style } className = { clsx ( 'motion-box' , className ) } />
997964 ) }
998965 </ CSSMotion >
999966 ) ;
0 commit comments