Index: third_party/polymer/v0_8/components/paper-input/test/paper-input-char-counter.html |
diff --git a/third_party/polymer/v0_8/components/paper-input/test/paper-input-char-counter.html b/third_party/polymer/v0_8/components/paper-input/test/paper-input-char-counter.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fd5bdfc41957605eaaabac19c04be8715445097b |
--- /dev/null |
+++ b/third_party/polymer/v0_8/components/paper-input/test/paper-input-char-counter.html |
@@ -0,0 +1,75 @@ |
+<!doctype html> |
+<!-- |
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt |
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt |
+Code distributed by Google as part of the polymer project is also |
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt |
+--> |
+<html> |
+<head> |
+ |
+ <title>paper-input-counter tests</title> |
+ |
+ <meta charset="utf-8"> |
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> |
+ |
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
+ |
+ <script src="../../web-component-tester/browser.js"></script> |
+ <script src="../../test-fixture/test-fixture-mocha.js"></script> |
+ |
+ <link rel="import" href="../../test-fixture/test-fixture.html"> |
+ <link rel="import" href="../../iron-input/iron-input.html"> |
+ <link rel="import" href="../paper-input-container.html"> |
+ <link rel="import" href="../paper-input-char-counter.html"> |
+ |
+</head> |
+<body> |
+ |
+ <test-fixture id="counter"> |
+ <template> |
+ <paper-input-container> |
+ <label id="l">label</label> |
+ <input id="i" value="foobar"> |
+ <paper-input-char-counter id="c"></paper-input-char-counter> |
+ </paper-input-container> |
+ </template> |
+ </test-fixture> |
+ |
+ <test-fixture id="counter-with-max"> |
+ <template> |
+ <paper-input-container> |
+ <label id="l">label</label> |
+ <input id="i" value="foobar" maxlength="10"> |
+ <paper-input-char-counter id="c"></paper-input-char-counter> |
+ </paper-input-container> |
+ </template> |
+ </test-fixture> |
+ |
+ <script> |
+ |
+ suite('basic', function() { |
+ |
+ test('character counter shows the value length', function() { |
+ var container = fixture('counter'); |
+ var input = Polymer.dom(container).querySelector('#i'); |
+ var counter = Polymer.dom(container).querySelector('#c'); |
+ assert.equal(counter.charCounter, input.value.length, 'character counter shows input value length'); |
+ }); |
+ |
+ test('character counter shows the value length with maxlength', function() { |
+ var container = fixture('counter-with-max'); |
+ var input = Polymer.dom(container).querySelector('#i'); |
+ var counter = Polymer.dom(container).querySelector('#c'); |
+ assert.equal(counter.charCounter, input.value.length + '/' + input.maxLength, 'character counter shows input value length and maxLength'); |
+ }); |
+ |
+ }); |
+ |
+ </script> |
+ |
+</body> |
+</html> |