@@ -31,6 +31,7 @@ describe('tabs', () => {
3131 <vaadin-tabs>
3232 <vaadin-tab>Foo</vaadin-tab>
3333 <vaadin-tab>Bar</vaadin-tab>
34+ <vaadin-tab>Some</vaadin-tab>
3435 <span></span>
3536 <vaadin-tab disabled>Baz</vaadin-tab>
3637 <vaadin-tab>
@@ -59,7 +60,7 @@ describe('tabs', () => {
5960
6061 describe ( 'items' , ( ) => {
6162 it ( 'should only add vaadin-tab components to items' , ( ) => {
62- expect ( tabs . items . length ) . to . equal ( 4 ) ;
63+ expect ( tabs . items . length ) . to . equal ( 5 ) ;
6364 tabs . items . forEach ( ( item ) => {
6465 expect ( item . tagName . toLowerCase ( ) ) . to . equal ( 'vaadin-tab' ) ;
6566 } ) ;
@@ -114,6 +115,10 @@ describe('tabs', () => {
114115 await nextFrame ( ) ;
115116 } ) ;
116117
118+ afterEach ( ( ) => {
119+ document . body . style . zoom = '' ;
120+ } ) ;
121+
117122 it ( `when orientation=${ orientation } should have overflow="end" if scroll is at the beginning` , ( ) => {
118123 expect ( tabs . getAttribute ( 'overflow' ) ) . to . be . equal ( 'end' ) ;
119124 } ) ;
@@ -127,18 +132,24 @@ describe('tabs', () => {
127132 tabs . _scroll ( horizontalRtl ? - 2 : 2 ) ;
128133 } ) ;
129134
130- // TODO: passes locally but fails in GitHub Actions due to 1px difference.
131- const chrome = / H e a d l e s s C h r o m e / u. test ( navigator . userAgent ) ;
132- ( horizontalRtl && chrome ? it . skip : it ) (
133- `when orientation=${ orientation } should have overflow="start" if scroll is at the end` ,
134- ( done ) => {
135+ it ( `when orientation=${ orientation } should have overflow="start" if scroll is at the end` , ( done ) => {
136+ listenOnce ( tabs . _scrollerElement , 'scroll' , ( ) => {
137+ expect ( tabs . getAttribute ( 'overflow' ) ) . to . be . equal ( 'start' ) ;
138+ done ( ) ;
139+ } ) ;
140+ tabs . _scroll ( horizontalRtl ? - 200 : 200 ) ;
141+ } ) ;
142+
143+ [ 1.25 , 1.33 , 1.5 , 1.75 ] . forEach ( ( zoomLevel ) => {
144+ it ( `when orientation=${ orientation } should have overflow="start" if scroll is at the end on page zoomed to ${ zoomLevel } ` , ( done ) => {
145+ document . body . style . zoom = zoomLevel ;
135146 listenOnce ( tabs . _scrollerElement , 'scroll' , ( ) => {
136147 expect ( tabs . getAttribute ( 'overflow' ) ) . to . be . equal ( 'start' ) ;
137148 done ( ) ;
138149 } ) ;
139150 tabs . _scroll ( horizontalRtl ? - 200 : 200 ) ;
140- } ,
141- ) ;
151+ } ) ;
152+ } ) ;
142153
143154 it ( `when orientation=${ orientation } should not have overflow="start" when over-scrolling` , ( ) => {
144155 const scroll = tabs . _scrollerElement ;
0 commit comments