@@ -5,12 +5,12 @@ import { awaitFakeTimer } from './util';
5
5
import type { TriggerProps } from '../src' ;
6
6
import classNames from 'classnames' ;
7
7
8
- // Mock UniqueBody to check if open props changed
8
+ // Mock UniqueContainer to check if open props changed
9
9
global . openChangeLog = [ ] ;
10
10
11
- jest . mock ( '../src/UniqueProvider/UniqueBody ' , ( ) => {
12
- const OriginalUniqueBody = jest . requireActual (
13
- '../src/UniqueProvider/UniqueBody ' ,
11
+ jest . mock ( '../src/UniqueProvider/UniqueContainer ' , ( ) => {
12
+ const OriginalUniqueContainer = jest . requireActual (
13
+ '../src/UniqueProvider/UniqueContainer ' ,
14
14
) . default ;
15
15
const OriginReact = jest . requireActual ( 'react' ) ;
16
16
@@ -25,7 +25,7 @@ jest.mock('../src/UniqueProvider/UniqueBody', () => {
25
25
}
26
26
} , [ open ] ) ;
27
27
28
- return OriginReact . createElement ( OriginalUniqueBody , props ) ;
28
+ return OriginReact . createElement ( OriginalUniqueContainer , props ) ;
29
29
} ;
30
30
} ) ;
31
31
@@ -105,7 +105,7 @@ describe('Trigger.Unique', () => {
105
105
'-hidden' ,
106
106
) ;
107
107
expect (
108
- document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
108
+ document . querySelector ( '.rc-trigger-popup-unique-container ' ) . className ,
109
109
) . not . toContain ( '-hidden' ) ;
110
110
111
111
// Move from first to second trigger - popup should not hide, but content should change
@@ -122,13 +122,13 @@ describe('Trigger.Unique', () => {
122
122
'-hidden' ,
123
123
) ;
124
124
expect (
125
- document . querySelector ( '.rc-trigger-popup-unique-body ' ) . className ,
125
+ document . querySelector ( '.rc-trigger-popup-unique-container ' ) . className ,
126
126
) . not . toContain ( '-hidden' ) ;
127
127
128
128
// There should only be one popup element
129
129
expect ( document . querySelectorAll ( '.rc-trigger-popup' ) . length ) . toBe ( 1 ) ;
130
130
expect (
131
- document . querySelectorAll ( '.rc-trigger-popup-unique-body ' ) . length ,
131
+ document . querySelectorAll ( '.rc-trigger-popup-unique-container ' ) . length ,
132
132
) . toBe ( 1 ) ;
133
133
134
134
// FloatBg open prop should not have changed during transition (no close animation)
@@ -184,36 +184,36 @@ describe('Trigger.Unique', () => {
184
184
expect ( popup . className ) . toContain ( 'rc-trigger-popup-unique-controlled' ) ;
185
185
} ) ;
186
186
187
- it ( 'should apply uniqueBgClassName to UniqueBody component' , async ( ) => {
188
- await setupAndOpenPopup ( { uniqueBgClassName : 'custom-bg -class' } ) ;
187
+ it ( 'should apply uniqueContainerClassName to UniqueContainer component' , async ( ) => {
188
+ await setupAndOpenPopup ( { uniqueContainerClassName : 'custom-container -class' } ) ;
189
189
190
- // Check that UniqueBody has the custom background className
191
- const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
192
- expect ( uniqueBody ) . toBeTruthy ( ) ;
193
- expect ( uniqueBody . className ) . toContain ( 'custom-bg -class' ) ;
190
+ // Check that UniqueContainer has the custom container className
191
+ const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container ' ) ;
192
+ expect ( uniqueContainer ) . toBeTruthy ( ) ;
193
+ expect ( uniqueContainer . className ) . toContain ( 'custom-container -class' ) ;
194
194
} ) ;
195
195
196
- it ( 'should apply uniqueBgStyle to UniqueBody component' , async ( ) => {
196
+ it ( 'should apply uniqueContainerStyle to UniqueContainer component' , async ( ) => {
197
197
await setupAndOpenPopup ( {
198
- uniqueBgStyle : { backgroundColor : 'red' , border : '1px solid blue' } ,
198
+ uniqueContainerStyle : { backgroundColor : 'red' , border : '1px solid blue' } ,
199
199
} ) ;
200
200
201
- // Check that UniqueBody has the custom background style
202
- const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
203
- expect ( uniqueBody ) . toBeTruthy ( ) ;
204
- expect ( uniqueBody ) . toHaveStyle ( {
201
+ // Check that UniqueContainer has the custom container style
202
+ const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container ' ) ;
203
+ expect ( uniqueContainer ) . toBeTruthy ( ) ;
204
+ expect ( uniqueContainer ) . toHaveStyle ( {
205
205
backgroundColor : 'red' ,
206
206
border : '1px solid blue' ,
207
207
} ) ;
208
208
} ) ;
209
209
210
- it ( 'should not apply any additional className to UniqueBody when uniqueBgClassName is not provided' , async ( ) => {
210
+ it ( 'should not apply any additional className to UniqueContainer when uniqueContainerClassName is not provided' , async ( ) => {
211
211
await setupAndOpenPopup ( ) ;
212
212
213
- // Check that UniqueBody exists but does not have custom background className
214
- const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
215
- expect ( uniqueBody ) . toBeTruthy ( ) ;
216
- expect ( uniqueBody . className ) . not . toContain ( 'undefined' ) ;
213
+ // Check that UniqueContainer exists but does not have custom container className
214
+ const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container ' ) ;
215
+ expect ( uniqueContainer ) . toBeTruthy ( ) ;
216
+ expect ( uniqueContainer . className ) . not . toContain ( 'undefined' ) ;
217
217
} ) ;
218
218
219
219
it ( 'should pass alignedClassName on unique body' , async ( ) => {
@@ -246,13 +246,13 @@ describe('Trigger.Unique', () => {
246
246
) ;
247
247
248
248
expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass ( 'bamboo' ) ;
249
- expect ( document . querySelector ( '.rc-trigger-popup-unique-body ' ) ) . toHaveClass (
249
+ expect ( document . querySelector ( '.rc-trigger-popup-unique-container ' ) ) . toHaveClass (
250
250
'bamboo' ,
251
251
) ;
252
252
253
253
// Check that arrow position CSS variables are set
254
- const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body ' ) ;
255
- const computedStyle = getComputedStyle ( uniqueBody ) ;
254
+ const uniqueContainer = document . querySelector ( '.rc-trigger-popup-unique-container ' ) ;
255
+ const computedStyle = getComputedStyle ( uniqueContainer ) ;
256
256
expect ( computedStyle . getPropertyValue ( '--arrow-x' ) ) . not . toBe ( '' ) ;
257
257
expect ( computedStyle . getPropertyValue ( '--arrow-y' ) ) . not . toBe ( '' ) ;
258
258
} ) ;
0 commit comments