@@ -48,13 +48,13 @@ describe('md-slider', function() {
48
48
it ( 'should not set model below the min' , function ( ) {
49
49
var slider = setup ( 'ng-model="value" min="0" max="100"' ) ;
50
50
pageScope . $apply ( 'value = -50' ) ;
51
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '0' ) ;
51
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '0' ) ;
52
52
} ) ;
53
53
54
54
it ( 'should not set model above the max' , function ( ) {
55
55
var slider = setup ( 'ng-model="value" min="0" max="100"' ) ;
56
56
pageScope . $apply ( 'value = 150' ) ;
57
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '100' ) ;
57
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '100' ) ;
58
58
} ) ;
59
59
60
60
it ( 'should set model on press' , function ( ) {
@@ -145,19 +145,19 @@ describe('md-slider', function() {
145
145
pageScope . max = 5 ;
146
146
pageScope . model = 5 ;
147
147
pageScope . $apply ( ) ;
148
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '5' ) ;
149
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '5' ) ;
148
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '5' ) ;
149
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '5' ) ;
150
150
pageScope . model = 6 ;
151
151
pageScope . max = 6 ;
152
152
pageScope . $apply ( ) ;
153
153
} ) ;
154
154
155
155
it ( 'should have updated max correctly' , function ( ) {
156
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '6' ) ;
156
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '6' ) ;
157
157
} ) ;
158
158
159
159
it ( 'should have updated value correctly' , function ( ) {
160
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
160
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
161
161
} ) ;
162
162
163
163
} ) ;
@@ -171,19 +171,19 @@ describe('md-slider', function() {
171
171
pageScope . max = 4 ;
172
172
pageScope . model = 3 ;
173
173
pageScope . $apply ( ) ;
174
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
175
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '4' ) ;
174
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
175
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '4' ) ;
176
176
pageScope . model = 6 ;
177
177
pageScope . max = 7 ;
178
178
pageScope . $apply ( ) ;
179
179
} ) ;
180
180
181
181
it ( 'should have updated max correctly' , function ( ) {
182
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '7' ) ;
182
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '7' ) ;
183
183
} ) ;
184
184
185
185
it ( 'should have updated value correctly' , function ( ) {
186
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
186
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
187
187
} ) ;
188
188
189
189
} ) ;
@@ -197,19 +197,19 @@ describe('md-slider', function() {
197
197
pageScope . max = 4 ;
198
198
pageScope . model = 2 ;
199
199
pageScope . $apply ( ) ;
200
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '2' ) ;
201
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '4' ) ;
200
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '2' ) ;
201
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '4' ) ;
202
202
pageScope . model = 3 ;
203
203
pageScope . max = 5 ;
204
204
pageScope . $apply ( ) ;
205
205
} ) ;
206
206
207
207
it ( 'should have updated max correctly' , function ( ) {
208
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '5' ) ;
208
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '5' ) ;
209
209
} ) ;
210
210
211
211
it ( 'should have updated value correctly' , function ( ) {
212
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
212
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
213
213
} ) ;
214
214
215
215
} ) ;
@@ -223,19 +223,19 @@ describe('md-slider', function() {
223
223
pageScope . min = 5 ;
224
224
pageScope . model = 5 ;
225
225
pageScope . $apply ( ) ;
226
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '5' ) ;
227
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
226
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '5' ) ;
227
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
228
228
pageScope . model = 2 ;
229
229
pageScope . min = 2 ;
230
230
pageScope . $apply ( ) ;
231
231
} ) ;
232
232
233
233
it ( 'should have updated min correctly' , function ( ) {
234
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
234
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
235
235
} ) ;
236
236
237
237
it ( 'should have updated value correctly' , function ( ) {
238
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '2' ) ;
238
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '2' ) ;
239
239
} ) ;
240
240
241
241
} ) ;
@@ -249,19 +249,19 @@ describe('md-slider', function() {
249
249
pageScope . min = 5 ;
250
250
pageScope . model = 6 ;
251
251
pageScope . $apply ( ) ;
252
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
253
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
252
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
253
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
254
254
pageScope . model = 3 ;
255
255
pageScope . min = 2 ;
256
256
pageScope . $apply ( ) ;
257
257
} ) ;
258
258
259
259
it ( 'should have updated min correctly' , function ( ) {
260
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
260
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
261
261
} ) ;
262
262
263
263
it ( 'should have updated value correctly' , function ( ) {
264
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
264
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '3' ) ;
265
265
} ) ;
266
266
267
267
} ) ;
@@ -275,19 +275,19 @@ describe('md-slider', function() {
275
275
pageScope . min = 5 ;
276
276
pageScope . model = 7 ;
277
277
pageScope . $apply ( ) ;
278
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '7' ) ;
279
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
278
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '7' ) ;
279
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '5' ) ;
280
280
pageScope . model = 6 ;
281
281
pageScope . min = 2 ;
282
282
pageScope . $apply ( ) ;
283
283
} ) ;
284
284
285
285
it ( 'should have updated min correctly' , function ( ) {
286
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
286
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '2' ) ;
287
287
} ) ;
288
288
289
289
it ( 'should have updated value correctly' , function ( ) {
290
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
290
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '6' ) ;
291
291
} ) ;
292
292
293
293
} ) ;
@@ -346,17 +346,17 @@ describe('md-slider', function() {
346
346
347
347
pageScope . $apply ( 'model = 102' ) ;
348
348
349
- expect ( slider . attr ( 'role' ) ) . toEqual ( 'slider' ) ;
350
- expect ( slider . attr ( 'aria-valuemin' ) ) . toEqual ( '100' ) ;
351
- expect ( slider . attr ( 'aria-valuemax' ) ) . toEqual ( '104' ) ;
352
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '102' ) ;
349
+ expect ( wrapper . attr ( 'role' ) ) . toEqual ( 'slider' ) ;
350
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemin' ) ) . toEqual ( '100' ) ;
351
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuemax' ) ) . toEqual ( '104' ) ;
352
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '102' ) ;
353
353
354
354
wrapper . triggerHandler ( {
355
355
type : 'keydown' ,
356
356
keyCode : $mdConstant . KEY_CODE . LEFT_ARROW
357
357
} ) ;
358
358
$timeout . flush ( ) ;
359
- expect ( slider . attr ( 'aria-valuenow' ) ) . toEqual ( '100' ) ;
359
+ expect ( getWrapper ( slider ) . attr ( 'aria-valuenow' ) ) . toEqual ( '100' ) ;
360
360
} ) ;
361
361
362
362
it ( 'should ignore pressdown events when disabled' , function ( ) {
0 commit comments