4
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
Code distributed by Google as part of the polymer project is also
9
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
13
<meta charset="UTF-8">
14
<title>paper-card a11y tests</title>
15
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
17
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
18
<script src="../../web-component-tester/browser.js"></script>
19
<link rel="import" href="../paper-card.html">
29
<test-fixture id="basic">
31
<paper-card heading="header">
32
<div class="card-content"><p>Sample content</p></div>
38
suite('a11y', function() {
44
test('aria-label set on card', function() {
45
assert.strictEqual(f.getAttribute('aria-label'), f.heading);
48
test('aria-label can be updated', function() {
49
assert.strictEqual(f.getAttribute('aria-label'), f.heading);
51
assert.strictEqual(f.getAttribute('aria-label'), 'batman');
54
suite('header image', function() {
58
img = f.$$('iron-image');
61
test('is iron-image', function(){
65
test('width properly setup', function() {
66
assert.strictEqual(img.offsetWidth, 0);
67
f.image = 'some-img-url';
68
assert.strictEqual(img.src, f.image);
69
assert.strictEqual(img.offsetWidth, f.offsetWidth);
72
test('preload properly setup', function() {
73
assert.strictEqual(img.preload, f.preloadImage);
74
f.preloadImage = !f.preloadImage;
75
assert.strictEqual(img.preload, f.preloadImage);
78
test('fade properly setup', function() {
79
assert.strictEqual(img.fade, f.fadeImage);
80
f.fadeImage = !f.fadeImage;
81
assert.strictEqual(img.fade, f.fadeImage);