@@ -3,7 +3,7 @@ import React from 'react';
33import Trigger , { UniqueProvider , type UniqueProviderProps } from '../src' ;
44import { awaitFakeTimer } from './util' ;
55import type { TriggerProps } from '../src' ;
6- import classNames from 'classnames ' ;
6+ import { clsx } from 'clsx ' ;
77
88// Mock UniqueContainer to check if open props changed
99global . openChangeLog = [ ] ;
@@ -185,21 +185,30 @@ describe('Trigger.Unique', () => {
185185 } ) ;
186186
187187 it ( 'should apply uniqueContainerClassName to UniqueContainer component' , async ( ) => {
188- await setupAndOpenPopup ( { uniqueContainerClassName : 'custom-container-class' } ) ;
188+ await setupAndOpenPopup ( {
189+ uniqueContainerClassName : 'custom-container-class' ,
190+ } ) ;
189191
190192 // Check that UniqueContainer has the custom container className
191- const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container' ) ;
193+ const uniqueContainer = document . querySelector (
194+ '.rc-trigger-popup-unique-container' ,
195+ ) ;
192196 expect ( uniqueContainer ) . toBeTruthy ( ) ;
193197 expect ( uniqueContainer . className ) . toContain ( 'custom-container-class' ) ;
194198 } ) ;
195199
196200 it ( 'should apply uniqueContainerStyle to UniqueContainer component' , async ( ) => {
197201 await setupAndOpenPopup ( {
198- uniqueContainerStyle : { backgroundColor : 'red' , border : '1px solid blue' } ,
202+ uniqueContainerStyle : {
203+ backgroundColor : 'red' ,
204+ border : '1px solid blue' ,
205+ } ,
199206 } ) ;
200207
201208 // Check that UniqueContainer has the custom container style
202- const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container' ) ;
209+ const uniqueContainer = document . querySelector (
210+ '.rc-trigger-popup-unique-container' ,
211+ ) ;
203212 expect ( uniqueContainer ) . toBeTruthy ( ) ;
204213 expect ( uniqueContainer ) . toHaveStyle ( {
205214 backgroundColor : 'red' ,
@@ -211,7 +220,9 @@ describe('Trigger.Unique', () => {
211220 await setupAndOpenPopup ( ) ;
212221
213222 // Check that UniqueContainer exists but does not have custom container className
214- const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container' ) ;
223+ const uniqueContainer = document . querySelector (
224+ '.rc-trigger-popup-unique-container' ,
225+ ) ;
215226 expect ( uniqueContainer ) . toBeTruthy ( ) ;
216227 expect ( uniqueContainer . className ) . not . toContain ( 'undefined' ) ;
217228 } ) ;
@@ -246,12 +257,14 @@ describe('Trigger.Unique', () => {
246257 ) ;
247258
248259 expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass ( 'bamboo' ) ;
249- expect ( document . querySelector ( '.rc-trigger-popup-unique-container' ) ) . toHaveClass (
250- 'bamboo' ,
251- ) ;
260+ expect (
261+ document . querySelector ( '.rc-trigger-popup-unique-container' ) ,
262+ ) . toHaveClass ( 'bamboo' ) ;
252263
253264 // Check that arrow position CSS variables are set
254- const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container' ) ;
265+ const uniqueContainer = document . querySelector (
266+ '.rc-trigger-popup-unique-container' ,
267+ ) ;
255268 const computedStyle = getComputedStyle ( uniqueContainer ) ;
256269 expect ( computedStyle . getPropertyValue ( '--arrow-x' ) ) . not . toBe ( '' ) ;
257270 expect ( computedStyle . getPropertyValue ( '--arrow-y' ) ) . not . toBe ( '' ) ;
@@ -262,10 +275,7 @@ describe('Trigger.Unique', () => {
262275 options ,
263276 ) => ( {
264277 ...options ,
265- popupClassName : classNames (
266- options . popupClassName ,
267- 'custom-post-options-class' ,
268- ) ,
278+ popupClassName : clsx ( options . popupClassName , 'custom-post-options-class' ) ,
269279 } ) ;
270280
271281 render (
@@ -293,7 +303,7 @@ describe('Trigger.Unique', () => {
293303 // Mock useAlign to return our mock onAlign function
294304 const useAlignModule = require ( '../src/hooks/useAlign' ) ;
295305 const originalUseAlign = useAlignModule . default ;
296-
306+
297307 jest . spyOn ( useAlignModule , 'default' ) . mockImplementation ( ( ...args ) => {
298308 const originalResult = originalUseAlign ( ...args ) ;
299309 // Replace onAlign with our mock
@@ -319,7 +329,7 @@ describe('Trigger.Unique', () => {
319329
320330 return (
321331 < div >
322- < button
332+ < button
323333 className = "switch-trigger-btn"
324334 onClick = { ( ) => {
325335 // Switch which trigger is open - this changes the target
0 commit comments