OLD | NEW |
(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 <meta charset="UTF-8"> |
| 13 <title>paper-card basic tests</title> |
| 14 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-
scale=1.0"> |
| 15 |
| 16 <script src="../../webcomponentsjs/webcomponents.js"></script> |
| 17 <script src="../../web-component-tester/browser.js"></script> |
| 18 <script src="../../test-fixture/test-fixture-mocha.js"></script> |
| 19 |
| 20 <link href="../../test-fixture/test-fixture.html" rel="import"> |
| 21 <link href="../../layout/layout.html" rel="import"> |
| 22 <link href="../paper-card.html" rel="import"> |
| 23 |
| 24 </head> |
| 25 <body> |
| 26 <test-fixture id="TrivialCard"> |
| 27 <template> |
| 28 <paper-card elevation="1"></paper-card> |
| 29 </template> |
| 30 </test-fixture> |
| 31 |
| 32 <test-fixture id="ProgressiveElevations"> |
| 33 <template> |
| 34 <paper-card elevation="1"></paper-card> |
| 35 <paper-card elevation="2"></paper-card> |
| 36 <paper-card elevation="3"></paper-card> |
| 37 <paper-card elevation="4"></paper-card> |
| 38 <paper-card elevation="5"></paper-card> |
| 39 </template> |
| 40 </test-fixture> |
| 41 |
| 42 <script> |
| 43 suite('<paper-card>', function() { |
| 44 suite('with a non-zero elevation attribute', function() { |
| 45 var style; |
| 46 var card; |
| 47 |
| 48 setup(function() { |
| 49 card = fixture('TrivialCard'); |
| 50 style = window.getComputedStyle(card); |
| 51 }); |
| 52 |
| 53 test('has a shadow', function() { |
| 54 expect(style.boxShadow).to.be.ok; |
| 55 expect(style.boxShadow).to.not.be.eql('none'); |
| 56 }); |
| 57 |
| 58 test('loses shadow with elevation value 0', function() { |
| 59 card.elevation = 0; |
| 60 expect(style.boxShadow).to.be.eql('none'); |
| 61 }); |
| 62 }); |
| 63 |
| 64 suite('progressively increasing values of elevation', function() { |
| 65 var cards; |
| 66 |
| 67 setup(function() { |
| 68 cards = fixture('ProgressiveElevations'); |
| 69 }); |
| 70 |
| 71 test('yield progressively "deeper" cards', function() { |
| 72 var lastStyle; |
| 73 var style; |
| 74 |
| 75 expect(cards.length).to.be.eql(5); |
| 76 |
| 77 cards.forEach(function (card) { |
| 78 style = window.getComputedStyle(card); |
| 79 |
| 80 expect(style.boxShadow).to.be.ok; |
| 81 expect(style.boxShadow).to.not.be.eql('none'); |
| 82 expect(style.boxShadow).to.not.be.eql(lastStyle && lastStyle.boxShad
ow); |
| 83 |
| 84 lastStyle = style; |
| 85 }); |
| 86 }); |
| 87 }); |
| 88 }); |
| 89 </script> |
| 90 </body> |
| 91 </html> |
OLD | NEW |