update components
This commit is contained in:
@@ -22,6 +22,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../paper-input.html">
|
||||
@@ -42,6 +43,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="label-has-value">
|
||||
<template>
|
||||
<paper-input label="foo" value="bar"></paper-input>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="error">
|
||||
<template>
|
||||
<paper-input auto-validate pattern="[0-9]*" value="foobar" error-message="error"></paper-input>
|
||||
@@ -177,7 +184,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
// setTimeout to wait for potentially more, erroneous events
|
||||
setTimeout(function() {
|
||||
assert.equal(nFocusEvents, 1, 'one focus event fired');
|
||||
input.inputElement.blur();
|
||||
MockInteractions.blur(input.inputElement);
|
||||
});
|
||||
});
|
||||
input.addEventListener('blur', function() {
|
||||
@@ -188,11 +195,28 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
done();
|
||||
});
|
||||
});
|
||||
input.inputElement.focus();
|
||||
MockInteractions.focus(input.inputElement);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('focused styling (integration test)', function() {
|
||||
|
||||
test('underline is colored when input is focused', function(done) {
|
||||
var input = fixture('basic');
|
||||
var container = Polymer.dom(input.root).querySelector('paper-input-container');
|
||||
var line = Polymer.dom(container.root).querySelector('.underline');
|
||||
assert.isFalse(line.classList.contains('is-highlighted'), 'line is not highlighted when input is not focused');
|
||||
MockInteractions.focus(input.inputElement);
|
||||
requestAnimationFrame(function() {
|
||||
assert.isTrue(line.classList.contains('is-highlighted'), 'line is highlighted when input is focused');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
suite('validation', function() {
|
||||
|
||||
test('invalid attribute updated after calling validate()', function() {
|
||||
|
||||
Reference in New Issue
Block a user