@@ -4,12 +4,12 @@ import Trigger, { UniqueProvider } from '../src';
4
4
import { awaitFakeTimer } from './util' ;
5
5
import type { TriggerProps } from '../src' ;
6
6
7
- // Mock FloatBg to check if open props changed
7
+ // Mock UniqueBody to check if open props changed
8
8
global . openChangeLog = [ ] ;
9
9
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 ' ,
13
13
) . default ;
14
14
const OriginReact = jest . requireActual ( 'react' ) ;
15
15
@@ -24,7 +24,7 @@ jest.mock('../src/UniqueProvider/FloatBg', () => {
24
24
}
25
25
} , [ open ] ) ;
26
26
27
- return OriginReact . createElement ( OriginalFloatBg , props ) ;
27
+ return OriginReact . createElement ( OriginalUniqueBody , props ) ;
28
28
} ;
29
29
} ) ;
30
30
@@ -103,7 +103,7 @@ describe('Trigger.Unique', () => {
103
103
'-hidden' ,
104
104
) ;
105
105
expect (
106
- document . querySelector ( '.rc-trigger-popup-float-bg ' ) . className ,
106
+ document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
107
107
) . not . toContain ( '-hidden' ) ;
108
108
109
109
// Move from first to second trigger - popup should not hide, but content should change
@@ -120,12 +120,12 @@ describe('Trigger.Unique', () => {
120
120
'-hidden' ,
121
121
) ;
122
122
expect (
123
- document . querySelector ( '.rc-trigger-popup-float-bg ' ) . className ,
123
+ document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
124
124
) . not . toContain ( '-hidden' ) ;
125
125
126
126
// There should only be one popup element
127
127
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 (
129
129
1 ,
130
130
) ;
131
131
@@ -182,33 +182,33 @@ describe('Trigger.Unique', () => {
182
182
expect ( popup . className ) . toContain ( 'rc-trigger-popup-unique-controlled' ) ;
183
183
} ) ;
184
184
185
- it ( 'should apply uniqueBgClassName to FloatBg component' , async ( ) => {
185
+ it ( 'should apply uniqueBgClassName to UniqueBody component' , async ( ) => {
186
186
await setupAndOpenPopup ( { uniqueBgClassName : 'custom-bg-class' } ) ;
187
187
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' ) ;
192
192
} ) ;
193
193
194
- it ( 'should apply uniqueBgStyle to FloatBg component' , async ( ) => {
194
+ it ( 'should apply uniqueBgStyle to UniqueBody component' , async ( ) => {
195
195
await setupAndOpenPopup ( { uniqueBgStyle : { backgroundColor : 'red' , border : '1px solid blue' } } ) ;
196
196
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 ( {
201
201
backgroundColor : 'red' ,
202
202
border : '1px solid blue' ,
203
203
} ) ;
204
204
} ) ;
205
205
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 ( ) => {
207
207
await setupAndOpenPopup ( ) ;
208
208
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' ) ;
213
213
} ) ;
214
214
} ) ;
0 commit comments