@@ -125,9 +125,9 @@ describe('Trigger.Unique', () => {
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-unique-body' ) . length ) . toBe (
129
- 1 ,
130
- ) ;
128
+ expect (
129
+ document . querySelectorAll ( '.rc-trigger-popup-unique-body' ) . length ,
130
+ ) . toBe ( 1 ) ;
131
131
132
132
// FloatBg open prop should not have changed during transition (no close animation)
133
133
expect ( global . openChangeLog ) . toHaveLength ( 0 ) ;
@@ -192,7 +192,9 @@ describe('Trigger.Unique', () => {
192
192
} ) ;
193
193
194
194
it ( 'should apply uniqueBgStyle to UniqueBody component' , async ( ) => {
195
- await setupAndOpenPopup ( { uniqueBgStyle : { backgroundColor : 'red' , border : '1px solid blue' } } ) ;
195
+ await setupAndOpenPopup ( {
196
+ uniqueBgStyle : { backgroundColor : 'red' , border : '1px solid blue' } ,
197
+ } ) ;
196
198
197
199
// Check that UniqueBody has the custom background style
198
200
const uniqueBody = document . querySelector ( '.rc-trigger-popup-unique-body' ) ;
@@ -211,4 +213,38 @@ describe('Trigger.Unique', () => {
211
213
expect ( uniqueBody ) . toBeTruthy ( ) ;
212
214
expect ( uniqueBody . className ) . not . toContain ( 'undefined' ) ;
213
215
} ) ;
216
+
217
+ it ( 'should pass alignedClassName on unique body' , async ( ) => {
218
+ const getPopupClassNameFromAlign = ( ) => 'bamboo' ;
219
+
220
+ render (
221
+ < UniqueProvider >
222
+ < Trigger
223
+ action = { [ 'click' ] }
224
+ popup = { < strong className = "x-content" > tooltip</ strong > }
225
+ unique
226
+ popupVisible
227
+ popupPlacement = "bottomLeft"
228
+ getPopupClassNameFromAlign = { getPopupClassNameFromAlign }
229
+ builtinPlacements = { {
230
+ bottomLeft : {
231
+ points : [ 'tl' , 'bl' ] ,
232
+ offset : [ 0 , 4 ] ,
233
+ overflow : {
234
+ adjustX : 0 ,
235
+ adjustY : 1 ,
236
+ } ,
237
+ } ,
238
+ } }
239
+ >
240
+ < div className = "target" > click me</ div >
241
+ </ Trigger >
242
+ </ UniqueProvider > ,
243
+ ) ;
244
+
245
+ expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass ( 'bamboo' ) ;
246
+ expect ( document . querySelector ( '.rc-trigger-popup-unique-body' ) ) . toHaveClass (
247
+ 'bamboo' ,
248
+ ) ;
249
+ } ) ;
214
250
} ) ;
0 commit comments