merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -16,11 +16,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../paper-slider.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -181,14 +179,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
test('value should notify', function(done) {
|
||||
var targetValue = 10;
|
||||
|
||||
slider.addEventListener('value-changed', function(e) {
|
||||
assert.equal(e.detail.value, targetValue);
|
||||
done();
|
||||
});
|
||||
|
||||
slider.addEventListener('value-changed', onValueChanged);
|
||||
|
||||
slider.min = 0;
|
||||
slider.max = 100;
|
||||
slider.value = targetValue;
|
||||
|
||||
function onValueChanged(e) {
|
||||
assert.equal(e.detail.value, targetValue);
|
||||
done();
|
||||
slider.removeEventListener('value-changed', onValueChanged);
|
||||
}
|
||||
});
|
||||
|
||||
test('immediateValue should notify', function(done) {
|
||||
|
@ -199,7 +200,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(slider.immediateValue, targetValue);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
var cursor = MockInteractions.topLeftOfNode(slider.$.sliderBar);
|
||||
cursor.x += slider.$.sliderBar.getBoundingClientRect().width * targetValue/100;
|
||||
|
||||
|
@ -208,6 +209,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
MockInteractions.down(slider.$.sliderBar, cursor);
|
||||
});
|
||||
|
||||
test('max markers', function(done) {
|
||||
slider.min = 0;
|
||||
slider.max = 100;
|
||||
slider.snap = true;
|
||||
slider.step = 4;
|
||||
slider.maxMarkers = 10;
|
||||
flush(function() {
|
||||
assert.equal(slider.markers.length, 10);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue