1 description('Tests that we find controls if they have a range limitation and are in-range.');
3 var parentDiv = document.createElement('div');
4 document.body.appendChild(parentDiv);
5 parentDiv.innerHTML = '<input id="number1" type="number" min=0 max=10><input id="range1" type="range" min=0 max=10 value=5><input id="text1" type="text" min=0 max=10 value=5><input id="checkbox1" type="checkbox"> <input id="radio1" type="radio">';
7 debug('==> :in-range should match to an INPUT without a value:');
8 shouldBeEqualToString('document.querySelector("input[type=number]:in-range").id', 'number1');
11 debug('==> :in-range should match to an INPUT with an in-range value:');
12 parentDiv.firstChild.value = '5';
13 shouldBeEqualToString('document.querySelector("input[type=number]:in-range").id', 'number1');
14 shouldBeEqualToString('document.querySelector("input[type=range]:in-range").id', 'range1');
15 shouldBe('document.querySelectorAll(":in-range").length', '2');