Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: polymer_1.0.4/bower_components/paper-input/test/paper-input-error.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <!--
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
9 -->
10 <html>
11 <head>
12
13 <title>paper-input-error tests</title>
14
15 <meta charset="utf-8">
16 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
17 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initia l-scale=1, user-scalable=yes">
18
19 <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
20
21 <script src="../../web-component-tester/browser.js"></script>
22 <script src="../../test-fixture/test-fixture-mocha.js"></script>
23
24 <link rel="import" href="../../test-fixture/test-fixture.html">
25 <link rel="import" href="../../iron-input/iron-input.html">
26 <link rel="import" href="../paper-input-container.html">
27 <link rel="import" href="../paper-input-error.html">
28
29 </head>
30 <body>
31
32 <paper-input-container id="container">
33 <input is="iron-input">
34 <paper-input-error>error</paper-input-error>
35 </paper-input-container>
36
37 <test-fixture id="auto-validate-numbers">
38 <template>
39 <paper-input-container auto-validate attr-for-value="bind-value">
40 <label id="l">label</label>
41 <input is="iron-input" id="i" pattern="[0-9]*">
42 <paper-input-error id="e">error</paper-input-error>
43 </paper-input-container>
44 </template>
45 </test-fixture>
46
47 <script>
48
49 suite('basic', function() {
50
51 test('error message only appears when input is invalid', function() {
52 var container = fixture('auto-validate-numbers');
53 var input = Polymer.dom(container).querySelector('#i');
54 var error = Polymer.dom(container).querySelector('#e');
55 assert.equal(getComputedStyle(error).display, 'none', 'error is display: none');
56 input.bindValue = 'foobar';
57 assert.notEqual(getComputedStyle(error).display, 'none', 'error is not d isplay:none');
58 });
59
60 test('error message add on is registered', function() {
61 var container = document.getElementById('container');
62 assert.isTrue(container._addons && container._addons.length === 1, 'add on is registered');
63 });
64
65 });
66
67 </script>
68
69 </body>
70 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698