@@ -134,12 +134,17 @@ module('Integration | scroll indicators', function() {
134
134
} ,
135
135
} ) ;
136
136
137
+ let firstHeader = table . headers . objectAt ( 0 ) ;
138
+
139
+ // not necessarily 100px wide because of integer division
140
+ let lastHeader = table . headers . objectAt ( table . headers . length - 1 ) ;
141
+
137
142
assert . equal (
138
143
table . isScrollIndicatorRendered ( 'right' ) ,
139
144
true ,
140
145
'right scroll indicator is initially shown'
141
146
) ;
142
- assert . ok ( isOffset ( 'right' , 100 ) , 'right scroll indicator is offset' ) ;
147
+ assert . ok ( isOffset ( 'right' , lastHeader . width ) , 'right scroll indicator is offset' ) ;
143
148
assert . equal (
144
149
table . isScrollIndicatorRendered ( 'left' ) ,
145
150
false ,
@@ -154,13 +159,13 @@ module('Integration | scroll indicators', function() {
154
159
true ,
155
160
'right scroll indicator is shown during partial scroll'
156
161
) ;
157
- assert . ok ( isOffset ( 'right' , 100 ) , 'right scroll indicator is offset' ) ;
162
+ assert . ok ( isOffset ( 'right' , lastHeader . width ) , 'right scroll indicator is offset' ) ;
158
163
assert . equal (
159
164
table . isScrollIndicatorRendered ( 'left' ) ,
160
165
true ,
161
166
'left scroll indicator is shown during partial scroll'
162
167
) ;
163
- assert . ok ( isOffset ( 'left' , 100 ) , 'left scroll indicator is offset' ) ;
168
+ assert . ok ( isOffset ( 'left' , firstHeader . width ) , 'left scroll indicator is offset' ) ;
164
169
165
170
// scroll horizontally to the end
166
171
await scrollTo ( '[data-test-ember-table-overflow]' , SCROLL_MAX , 0 ) ;
@@ -175,7 +180,7 @@ module('Integration | scroll indicators', function() {
175
180
true ,
176
181
'left scroll indicator is still shown at end of scroll'
177
182
) ;
178
- assert . ok ( isOffset ( 'left' , 100 ) , 'left scroll indicator is offset' ) ;
183
+ assert . ok ( isOffset ( 'left' , firstHeader . width ) , 'left scroll indicator is offset' ) ;
179
184
} ) ;
180
185
181
186
test ( 'top scroll indicator positioned below header' , async function ( assert ) {
0 commit comments