@@ -30,19 +30,21 @@ describe('UUIPopoverContainerElement', () => {
3030 it ( 'should properly detect scroll parents in nested shadow DOM containers' , async ( ) => {
3131 // Create a test structure with nested shadow DOM and scroll containers
3232 const testContainer = await fixture ( html `
33- < div style ="height: 300px; overflow: auto; " id ="outer-scroll ">
34- < div style ="height: 200px; overflow: auto; " id ="inner-scroll ">
35- < div style ="height: 100px; "> </ div >
36- < uui-button id ="trigger-button " popovertarget ="test-popover "
37- > Open</ uui-button
38- >
39- < div style ="height: 400px; "> </ div >
33+ < main >
34+ < div style ="height: 300px; overflow: auto; " id ="outer-scroll ">
35+ < div style ="height: 200px; overflow: auto; " id ="inner-scroll ">
36+ < div style ="height: 100px; "> </ div >
37+ < uui-button id ="trigger-button " popovertarget ="test-popover "
38+ > Open</ uui-button
39+ >
40+ < div style ="height: 400px; "> </ div >
41+ </ div >
42+ < div style ="height: 500px; "> </ div >
4043 </ div >
41- < div style ="height: 500px; "> </ div >
42- </ div >
43- < uui-popover-container id ="test-popover " popover >
44- Test content
45- </ uui-popover-container >
44+ < uui-popover-container id ="test-popover " popover >
45+ Test content
46+ </ uui-popover-container >
47+ </ main >
4648 ` ) ;
4749
4850 const popover = testContainer . querySelector (
@@ -55,7 +57,7 @@ describe('UUIPopoverContainerElement', () => {
5557 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
5658
5759 // Access the private scroll parents array for testing
58- const scrollParents = ( popover as any ) [ '#scrollParents' ] ;
60+ const scrollParents = popover . _getScrollParents ( ) ;
5961
6062 // Should find both scroll containers
6163 expect ( scrollParents . length ) . to . be . greaterThan ( 0 ) ;
@@ -66,15 +68,17 @@ describe('UUIPopoverContainerElement', () => {
6668
6769 it ( 'should reset scroll parents when called multiple times' , async ( ) => {
6870 const testContainer = await fixture ( html `
69- < div style ="height: 300px; overflow: auto; " id ="scroll-container ">
70- < uui-button id ="trigger-button " popovertarget ="test-popover "
71- > Open</ uui-button
72- >
73- < div style ="height: 400px; "> </ div >
74- </ div >
75- < uui-popover-container id ="test-popover " popover >
76- Test content
77- </ uui-popover-container >
71+ < main >
72+ < div style ="height: 300px; overflow: auto; " id ="scroll-container ">
73+ < uui-button id ="trigger-button " popovertarget ="test-popover "
74+ > Open</ uui-button
75+ >
76+ < div style ="height: 400px; "> </ div >
77+ </ div >
78+ < uui-popover-container id ="test-popover " popover >
79+ Test content
80+ </ uui-popover-container >
81+ </ main >
7882 ` ) ;
7983
8084 const popover = testContainer . querySelector (
@@ -91,7 +95,7 @@ describe('UUIPopoverContainerElement', () => {
9195 button ?. click ( ) ;
9296 await new Promise ( resolve => setTimeout ( resolve , 50 ) ) ;
9397
94- const scrollParents = ( popover as any ) [ '#scrollParents' ] ;
98+ const scrollParents = popover . _getScrollParents ( ) ;
9599
96100 // Should not have duplicate entries
97101 const uniqueParents = [ ...new Set ( scrollParents ) ] ;
0 commit comments