@@ -1874,7 +1874,7 @@ describe('Table', () => {
1874
1874
expect ( loaderRow ) . toHaveTextContent ( 'spinner' ) ;
1875
1875
1876
1876
let sentinel = tree . getByTestId ( 'loadMoreSentinel' ) ;
1877
- expect ( sentinel . parentElement ) . toHaveAttribute ( 'inert' ) ;
1877
+ expect ( sentinel . parentElement . parentElement ) . toHaveAttribute ( 'inert' ) ;
1878
1878
} ) ;
1879
1879
1880
1880
it ( 'should render the sentinel but not the loading indicator when not loading' , async ( ) => {
@@ -1922,7 +1922,9 @@ describe('Table', () => {
1922
1922
expect ( onLoadMore ) . toHaveBeenCalledTimes ( 0 ) ;
1923
1923
let sentinel = tree . getByTestId ( 'loadMoreSentinel' ) ;
1924
1924
expect ( observe ) . toHaveBeenLastCalledWith ( sentinel ) ;
1925
- expect ( sentinel . nodeName ) . toBe ( 'TD' ) ;
1925
+ expect ( sentinel . nodeName ) . toBe ( 'DIV' ) ;
1926
+ expect ( sentinel . parentElement . nodeName ) . toBe ( 'TD' ) ;
1927
+ expect ( sentinel . parentElement . parentElement . nodeName ) . toBe ( 'TR' ) ;
1926
1928
1927
1929
expect ( onLoadMore ) . toHaveBeenCalledTimes ( 0 ) ;
1928
1930
act ( ( ) => { observer . instance . triggerCallback ( [ { isIntersecting : true } ] ) ; } ) ;
@@ -2075,7 +2077,7 @@ describe('Table', () => {
2075
2077
expect ( loaderParentStyles . height ) . toBe ( '30px' ) ;
2076
2078
2077
2079
let sentinel = within ( loaderRow . parentElement ) . getByTestId ( 'loadMoreSentinel' ) ;
2078
- expect ( sentinel . parentElement ) . toHaveAttribute ( 'inert' ) ;
2080
+ expect ( sentinel . parentElement . parentElement ) . toHaveAttribute ( 'inert' ) ;
2079
2081
} ) ;
2080
2082
2081
2083
it ( 'should not reserve room for the loader if isLoading is false' , ( ) => {
@@ -2086,10 +2088,10 @@ describe('Table', () => {
2086
2088
expect ( within ( tableTester . table ) . queryByText ( 'spinner' ) ) . toBeFalsy ( ) ;
2087
2089
2088
2090
let sentinel = within ( tableTester . table ) . getByTestId ( 'loadMoreSentinel' ) ;
2089
- let sentinelParentStyles = sentinel . parentElement . parentElement . style ;
2090
- expect ( sentinelParentStyles . top ) . toBe ( '1250px' ) ;
2091
- expect ( sentinelParentStyles . height ) . toBe ( '0px' ) ;
2092
- expect ( sentinel . parentElement ) . toHaveAttribute ( 'inert' ) ;
2091
+ let sentinelVirtWrapperStyles = sentinel . closest ( '[role="presentation"]' ) . style ;
2092
+ expect ( sentinelVirtWrapperStyles . top ) . toBe ( '1250px' ) ;
2093
+ expect ( sentinelVirtWrapperStyles . height ) . toBe ( '0px' ) ;
2094
+ expect ( sentinel . parentElement . parentElement ) . toHaveAttribute ( 'inert' ) ;
2093
2095
2094
2096
tree . rerender ( < VirtualizedTableLoad items = { [ ] } /> ) ;
2095
2097
rows = tableTester . rows ;
@@ -2098,9 +2100,9 @@ describe('Table', () => {
2098
2100
expect ( emptyStateRow ) . toHaveTextContent ( 'No results' ) ;
2099
2101
expect ( within ( tableTester . table ) . queryByText ( 'spinner' ) ) . toBeFalsy ( ) ;
2100
2102
sentinel = within ( tableTester . table ) . getByTestId ( 'loadMoreSentinel' , { hidden : true } ) ;
2101
- sentinelParentStyles = sentinel . parentElement . parentElement . style ;
2102
- expect ( sentinelParentStyles . top ) . toBe ( '0px' ) ;
2103
- expect ( sentinelParentStyles . height ) . toBe ( '0px' ) ;
2103
+ sentinelVirtWrapperStyles = sentinel . closest ( '[role="presentation"]' ) . style ;
2104
+ expect ( sentinelVirtWrapperStyles . top ) . toBe ( '0px' ) ;
2105
+ expect ( sentinelVirtWrapperStyles . height ) . toBe ( '0px' ) ;
2104
2106
2105
2107
tree . rerender ( < VirtualizedTableLoad items = { [ ] } loadingState = "loading" /> ) ;
2106
2108
rows = tableTester . rows ;
@@ -2109,9 +2111,9 @@ describe('Table', () => {
2109
2111
expect ( emptyStateRow ) . toHaveTextContent ( 'loading' ) ;
2110
2112
2111
2113
sentinel = within ( tableTester . table ) . getByTestId ( 'loadMoreSentinel' , { hidden : true } ) ;
2112
- sentinelParentStyles = sentinel . parentElement . parentElement . style ;
2113
- expect ( sentinelParentStyles . top ) . toBe ( '0px' ) ;
2114
- expect ( sentinelParentStyles . height ) . toBe ( '0px' ) ;
2114
+ sentinelVirtWrapperStyles = sentinel . closest ( '[role="presentation"]' ) . style ;
2115
+ expect ( sentinelVirtWrapperStyles . top ) . toBe ( '0px' ) ;
2116
+ expect ( sentinelVirtWrapperStyles . height ) . toBe ( '0px' ) ;
2115
2117
} ) ;
2116
2118
2117
2119
it ( 'should have the correct row indicies after loading more items' , async ( ) => {
0 commit comments