File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
elements/pf-back-to-top/test Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -159,9 +159,9 @@ describe('<pf-back-to-top>', function() {
159159 </ div >
160160 ` ) ;
161161 element = container . querySelector ( 'pf-back-to-top' ) ! ;
162- snapshot = await a11ySnapshot ( ) ;
163-
164162 await allUpdates ( element ) ;
163+
164+ snapshot = await a11ySnapshot ( { selector : 'pf-back-to-top' } ) ;
165165 } ) ;
166166
167167 it ( 'should be hidden on init' , function ( ) {
@@ -173,13 +173,14 @@ describe('<pf-back-to-top>', function() {
173173 beforeEach ( async function ( ) {
174174 const scrollableElement = document . querySelector ( '#top' ) ! ;
175175 scrollableElement . scrollTo ( { top : 401 , behavior : 'instant' } ) ;
176+ scrollableElement . dispatchEvent ( new Event ( 'scroll' ) ) ;
176177 await nextFrame ( ) ;
177178 await allUpdates ( element ) ;
178179 snapshot = await a11ySnapshot ( ) ;
179180 } ) ;
180181
181182 it ( 'should be visible' , function ( ) {
182- expect ( snapshot . children ?. map ( takeProps ( [ 'name' , 'role' ] ) ) ) . to . deep . equal ( [ { role : 'link' , name : 'Back to top' } ] ) ;
183+ expect ( snapshot . children ?. at ( 0 ) ?. children ?. map ( takeProps ( [ 'name' , 'role' ] ) ) ) . to . deep . equal ( [ { role : 'link' , name : 'Back to top' } ] ) ;
183184 } ) ;
184185 } ) ;
185186 } ) ;
You can’t perform that action at this time.
0 commit comments