File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/kit-headless/src/components/popover Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,29 @@ test.describe('Mouse Behavior', () => {
131131
132132 expect ( popoverBoundingBox ?. y ) . toBeLessThan ( triggerBoundingBox ?. y ?? 0 ) ;
133133 } ) ;
134+
135+ test ( `GIVEN a combobox with a gutter configured
136+ WHEN opening the combobox
137+ THEN the popover should be spaced 24px from the combobox` , async ( { page } ) => {
138+ const { driver : d } = await setup ( page , 'gutter' ) ;
139+
140+ const popover = d . getPopover ( ) ;
141+ const trigger = d . getTrigger ( ) ;
142+
143+ await trigger . click ( ) ;
144+
145+ await expect ( popover ) . toBeVisible ( ) ;
146+
147+ const popoverBoundingBox = await popover . boundingBox ( ) ;
148+ const triggerBoundingBox = await trigger . boundingBox ( ) ;
149+
150+ console . log ( triggerBoundingBox , popoverBoundingBox ) ;
151+
152+ const triggerBottomAbsolutePosition =
153+ ( triggerBoundingBox ?. y ?? 0 ) + ( triggerBoundingBox ?. height ?? 0 ) ;
154+
155+ expect ( ( popoverBoundingBox ?. y ?? 0 ) - triggerBottomAbsolutePosition ) . toBe ( 24 ) ;
156+ } ) ;
134157} ) ;
135158
136159test . describe ( 'Keyboard Behavior' , ( ) => {
You can’t perform that action at this time.
0 commit comments