@@ -4,12 +4,12 @@ import Trigger, { UniqueProvider } from '../src';
44import { awaitFakeTimer } from './util' ;
55import type { TriggerProps } from '../src' ;
66
7- // Mock FloatBg to check if open props changed
7+ // Mock UniqueBody to check if open props changed
88global . openChangeLog = [ ] ;
99
10- jest . mock ( '../src/UniqueProvider/FloatBg ' , ( ) => {
11- const OriginalFloatBg = jest . requireActual (
12- '../src/UniqueProvider/FloatBg ' ,
10+ jest . mock ( '../src/UniqueProvider/UniqueBody ' , ( ) => {
11+ const OriginalUniqueBody = jest . requireActual (
12+ '../src/UniqueProvider/UniqueBody ' ,
1313 ) . default ;
1414 const OriginReact = jest . requireActual ( 'react' ) ;
1515
@@ -24,7 +24,7 @@ jest.mock('../src/UniqueProvider/FloatBg', () => {
2424 }
2525 } , [ open ] ) ;
2626
27- return OriginReact . createElement ( OriginalFloatBg , props ) ;
27+ return OriginReact . createElement ( OriginalUniqueBody , props ) ;
2828 } ;
2929} ) ;
3030
@@ -103,7 +103,7 @@ describe('Trigger.Unique', () => {
103103 '-hidden' ,
104104 ) ;
105105 expect (
106- document . querySelector ( '.rc-trigger-popup-float-bg ' ) . className ,
106+ document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
107107 ) . not . toContain ( '-hidden' ) ;
108108
109109 // Move from first to second trigger - popup should not hide, but content should change
@@ -120,12 +120,12 @@ describe('Trigger.Unique', () => {
120120 '-hidden' ,
121121 ) ;
122122 expect (
123- document . querySelector ( '.rc-trigger-popup-float-bg ' ) . className ,
123+ document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
124124 ) . not . toContain ( '-hidden' ) ;
125125
126126 // There should only be one popup element
127127 expect ( document . querySelectorAll ( '.rc-trigger-popup' ) . length ) . toBe ( 1 ) ;
128- expect ( document . querySelectorAll ( '.rc-trigger-popup-float-bg ' ) . length ) . toBe (
128+ expect ( document . querySelectorAll ( '.rc-trigger-popup-unique-body ' ) . length ) . toBe (
129129 1 ,
130130 ) ;
131131
@@ -182,33 +182,33 @@ describe('Trigger.Unique', () => {
182182 expect ( popup . className ) . toContain ( 'rc-trigger-popup-unique-controlled' ) ;
183183 } ) ;
184184
185- it ( 'should apply uniqueBgClassName to FloatBg component' , async ( ) => {
185+ it ( 'should apply uniqueBgClassName to UniqueBody component' , async ( ) => {
186186 await setupAndOpenPopup ( { uniqueBgClassName : 'custom-bg-class' } ) ;
187187
188- // Check that FloatBg has the custom background className
189- const floatBg = document . querySelector ( '.rc-trigger-popup-float-bg ' ) ;
190- expect ( floatBg ) . toBeTruthy ( ) ;
191- expect ( floatBg . className ) . toContain ( 'custom-bg-class' ) ;
188+ // Check that UniqueBody has the custom background className
189+ const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
190+ expect ( uniqueBody ) . toBeTruthy ( ) ;
191+ expect ( uniqueBody . className ) . toContain ( 'custom-bg-class' ) ;
192192 } ) ;
193193
194- it ( 'should apply uniqueBgStyle to FloatBg component' , async ( ) => {
194+ it ( 'should apply uniqueBgStyle to UniqueBody component' , async ( ) => {
195195 await setupAndOpenPopup ( { uniqueBgStyle : { backgroundColor : 'red' , border : '1px solid blue' } } ) ;
196196
197- // Check that FloatBg has the custom background style
198- const floatBg = document . querySelector ( '.rc-trigger-popup-float-bg ' ) ;
199- expect ( floatBg ) . toBeTruthy ( ) ;
200- expect ( floatBg ) . toHaveStyle ( {
197+ // Check that UniqueBody has the custom background style
198+ const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
199+ expect ( uniqueBody ) . toBeTruthy ( ) ;
200+ expect ( uniqueBody ) . toHaveStyle ( {
201201 backgroundColor : 'red' ,
202202 border : '1px solid blue' ,
203203 } ) ;
204204 } ) ;
205205
206- it ( 'should not apply any additional className to FloatBg when uniqueBgClassName is not provided' , async ( ) => {
206+ it ( 'should not apply any additional className to UniqueBody when uniqueBgClassName is not provided' , async ( ) => {
207207 await setupAndOpenPopup ( ) ;
208208
209- // Check that FloatBg exists but does not have custom background className
210- const floatBg = document . querySelector ( '.rc-trigger-popup-float-bg ' ) ;
211- expect ( floatBg ) . toBeTruthy ( ) ;
212- expect ( floatBg . className ) . not . toContain ( 'undefined' ) ;
209+ // Check that UniqueBody exists but does not have custom background className
210+ const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
211+ expect ( uniqueBody ) . toBeTruthy ( ) ;
212+ expect ( uniqueBody . className ) . not . toContain ( 'undefined' ) ;
213213 } ) ;
214214} ) ;
0 commit comments