@@ -31,6 +31,7 @@ describe('tabs', () => {
31
31
<vaadin-tabs>
32
32
<vaadin-tab>Foo</vaadin-tab>
33
33
<vaadin-tab>Bar</vaadin-tab>
34
+ <vaadin-tab>Some</vaadin-tab>
34
35
<span></span>
35
36
<vaadin-tab disabled>Baz</vaadin-tab>
36
37
<vaadin-tab>
@@ -59,7 +60,7 @@ describe('tabs', () => {
59
60
60
61
describe ( 'items' , ( ) => {
61
62
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 ) ;
63
64
tabs . items . forEach ( ( item ) => {
64
65
expect ( item . tagName . toLowerCase ( ) ) . to . equal ( 'vaadin-tab' ) ;
65
66
} ) ;
@@ -114,6 +115,10 @@ describe('tabs', () => {
114
115
await nextFrame ( ) ;
115
116
} ) ;
116
117
118
+ afterEach ( ( ) => {
119
+ document . body . style . zoom = '' ;
120
+ } ) ;
121
+
117
122
it ( `when orientation=${ orientation } should have overflow="end" if scroll is at the beginning` , ( ) => {
118
123
expect ( tabs . getAttribute ( 'overflow' ) ) . to . be . equal ( 'end' ) ;
119
124
} ) ;
@@ -127,18 +132,24 @@ describe('tabs', () => {
127
132
tabs . _scroll ( horizontalRtl ? - 2 : 2 ) ;
128
133
} ) ;
129
134
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 / . 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 ;
135
146
listenOnce ( tabs . _scrollerElement , 'scroll' , ( ) => {
136
147
expect ( tabs . getAttribute ( 'overflow' ) ) . to . be . equal ( 'start' ) ;
137
148
done ( ) ;
138
149
} ) ;
139
150
tabs . _scroll ( horizontalRtl ? - 200 : 200 ) ;
140
- } ,
141
- ) ;
151
+ } ) ;
152
+ } ) ;
142
153
143
154
it ( `when orientation=${ orientation } should not have overflow="start" when over-scrolling` , ( ) => {
144
155
const scroll = tabs . _scrollerElement ;
0 commit comments