feat(ui): add thin horizontal single-value range rail
This commit is contained in:
@@ -117,3 +117,15 @@ test("both boundaries move, clamp independently, separate after coincidence and
|
||||
assert.deepEqual(move([0, 10], 1, 7.3, 0, 10, .5), [0, 7.5]);
|
||||
assert.deepEqual(move([0, 9], 1, 10.1, 0, 10.1, 3), [0, 10.1]);
|
||||
});
|
||||
|
||||
test("horizontal thin rail has one native boundary and a formatted value, without field chrome", () => {
|
||||
for(const disabled of [false,true]){
|
||||
const markup=renderToStaticMarkup(createElement(RangeControl,{variant:"rail",label:"Скорость",value:5,min:.1,max:100,step:.1,disabled,formatValue:n=>`${n} м/с`,onChange(){}}));
|
||||
assert.equal((markup.match(/type="range"/g)||[]).length,1);
|
||||
assert.match(markup,/aria-label="Скорость" aria-orientation="horizontal"/);
|
||||
assert.match(markup,/aria-valuetext="5 м\/с"/);
|
||||
assert.match(markup,/nodedc-range-rail__value/);
|
||||
assert.equal(markup.includes('disabled=""'),disabled);
|
||||
assert.doesNotMatch(markup,/nodedc-range__label|nodedc-range__editor|nodedc-glass/);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user