@@ -22,7 +22,7 @@ import td from 'testdouble';
22
22
import { createMockRaf } from '../helpers/raf' ;
23
23
import { TRANSFORM_PROP } from './helpers' ;
24
24
25
- import { strings } from '../../../packages/mdc-slider/constants' ;
25
+ import { cssClasses , strings } from '../../../packages/mdc-slider/constants' ;
26
26
import { MDCSlider } from '../../../packages/mdc-slider' ;
27
27
28
28
suite ( 'MDCSlider' ) ;
@@ -149,14 +149,23 @@ test('#initialSyncWithDOM adds an aria-valuemax attribute if not present', () =>
149
149
assert . equal ( root . getAttribute ( 'aria-valuemax' ) , String ( component . max ) ) ;
150
150
} ) ;
151
151
152
- test ( '#initialSyncWithDOM syncs the value property with aria-valuenow' , ( ) => {
152
+ test ( '#initialSyncWithDOM syncs the value property with aria-valuenow for continuous slider ' , ( ) => {
153
153
const root = getFixture ( ) ;
154
154
root . setAttribute ( 'aria-valuenow' , '30' ) ;
155
155
156
156
const component = new MDCSlider ( root ) ;
157
157
assert . equal ( component . value , 30 ) ;
158
158
} ) ;
159
159
160
+ test ( '#initialSyncWithDOM syncs the value property with aria-valuenow for discrete slider' , ( ) => {
161
+ const root = getFixture ( ) ;
162
+ root . classList . add ( cssClasses . DISCRETE ) ;
163
+ root . setAttribute ( 'aria-valuenow' , '30' ) ;
164
+
165
+ const component = new MDCSlider ( root ) ;
166
+ assert . equal ( component . value , 30 ) ;
167
+ } ) ;
168
+
160
169
test ( '#initialSyncWithDOM adds an aria-valuenow attribute if not present' , ( ) => {
161
170
const root = getFixture ( ) ;
162
171
root . removeAttribute ( 'aria-valuenow' ) ;
0 commit comments