File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -296,4 +296,41 @@ describe('Trigger.Align', () => {
296296 top : `56px` ,
297297 } ) ;
298298 } ) ;
299+
300+ it ( 'both adjustX and adjustY should get correct points' , async ( ) => {
301+ // Set target position to top left corner to force flip to bottom right
302+ rectX = 0 ;
303+ rectY = 0 ;
304+ rectWidth = 100 ;
305+ rectHeight = 100 ;
306+
307+ const onPopupAlign = jest . fn ( ) ;
308+
309+ render (
310+ < Trigger
311+ popupVisible
312+ popup = { < span className = "bamboo" /> }
313+ popupAlign = { {
314+ points : [ 'tl' , 'bl' ] ,
315+ overflow : {
316+ adjustX : true ,
317+ adjustY : true ,
318+ } ,
319+ } }
320+ onPopupAlign = { onPopupAlign }
321+ >
322+ < div />
323+ </ Trigger > ,
324+ ) ;
325+
326+ await awaitFakeTimer ( ) ;
327+
328+ // Check that the points have been flipped correctly
329+ expect ( onPopupAlign ) . toHaveBeenCalledWith (
330+ expect . anything ( ) ,
331+ expect . objectContaining ( {
332+ points : [ 'br' , 'tr' ] ,
333+ } ) ,
334+ ) ;
335+ } ) ;
299336} ) ;
You can’t perform that action at this time.
0 commit comments