| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 @license |
| 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://polym
er.github.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/CO
NTRIBUTORS.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/P
ATENTS.txt |
| 9 --> |
| 10 <!DOCTYPE html> |
| 11 <html> |
| 12 <head> |
| 13 |
| 14 <title>paper-header-panel tests</title> |
| 15 |
| 16 <meta charset="utf-8"> |
| 17 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 18 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-
scale=1, user-scalable=yes"> |
| 19 |
| 20 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 21 |
| 22 <script src="../../web-component-tester/browser.js"></script> |
| 23 <script src="../../test-fixture/test-fixture-mocha.js"></script> |
| 24 |
| 25 <link rel="import" href="../../test-fixture/test-fixture.html"> |
| 26 <link rel="import" href="../paper-header-panel.html"> |
| 27 |
| 28 <style> |
| 29 |
| 30 paper-header-panel { |
| 31 height: 100%; |
| 32 } |
| 33 |
| 34 </style> |
| 35 |
| 36 </head> |
| 37 <body> |
| 38 |
| 39 <test-fixture id="standard"> |
| 40 <template> |
| 41 <paper-header-panel mode="standard"> |
| 42 <div class="paper-header">header</div> |
| 43 <div>body</div> |
| 44 </paper-header-panel> |
| 45 </template> |
| 46 </test-fixture> |
| 47 |
| 48 <test-fixture id="seamed"> |
| 49 <template> |
| 50 <paper-header-panel mode="seamed"> |
| 51 <div class="paper-header">header</div> |
| 52 <div>body</div> |
| 53 </paper-header-panel> |
| 54 </template> |
| 55 </test-fixture> |
| 56 |
| 57 <test-fixture id="seamed-shadow"> |
| 58 <template> |
| 59 <paper-header-panel mode="seamed" shadow> |
| 60 <div class="paper-header">header</div> |
| 61 <div>body</div> |
| 62 </paper-header-panel> |
| 63 </template> |
| 64 </test-fixture> |
| 65 |
| 66 <test-fixture id="waterfall"> |
| 67 <template> |
| 68 <paper-header-panel mode="waterfall"> |
| 69 <div class="paper-header">header</div> |
| 70 <div>body</div> |
| 71 </paper-header-panel> |
| 72 </template> |
| 73 </test-fixture> |
| 74 |
| 75 <test-fixture id="waterfall-tall"> |
| 76 <template> |
| 77 <paper-header-panel mode="waterfall-tall"> |
| 78 <div class="paper-header">header</div> |
| 79 <div>body</div> |
| 80 </paper-header-panel> |
| 81 </template> |
| 82 </test-fixture> |
| 83 |
| 84 <test-fixture id="scroll"> |
| 85 <template> |
| 86 <paper-header-panel mode="scroll"> |
| 87 <div class="paper-header">header</div> |
| 88 <div>body</div> |
| 89 </paper-header-panel> |
| 90 </template> |
| 91 </test-fixture> |
| 92 |
| 93 <test-fixture id="cover"> |
| 94 <template> |
| 95 <paper-header-panel mode="cover"> |
| 96 <div class="paper-header">header</div> |
| 97 <div>body</div> |
| 98 </paper-header-panel> |
| 99 </template> |
| 100 </test-fixture> |
| 101 |
| 102 <script> |
| 103 |
| 104 suite('shadow', function() { |
| 105 var standard, seamed, waterfall, waterfallTall, scroll, cover; |
| 106 |
| 107 setup(function(done) { |
| 108 standard = fixture('standard'); |
| 109 seamed = fixture('seamed'); |
| 110 seamedShadow = fixture('seamed-shadow'); |
| 111 waterfall = fixture('waterfall'); |
| 112 waterfallTall = fixture('waterfall-tall'); |
| 113 scroll = fixture('scroll'); |
| 114 cover = fixture('cover'); |
| 115 // async to let change handlers fire |
| 116 setTimeout(done, 0); |
| 117 }); |
| 118 |
| 119 function hasShadow(panel) { |
| 120 return panel.visibleShadow; |
| 121 }; |
| 122 |
| 123 test('has shadow in standard mode', function() { |
| 124 assert.isTrue(hasShadow(standard), 'shadow has display'); |
| 125 }); |
| 126 |
| 127 test('no shadow in seamed mode', function() { |
| 128 assert.isFalse(hasShadow(seamed), 'shadow is display:none'); |
| 129 }); |
| 130 |
| 131 test('no shadow in waterfall mode', function() { |
| 132 assert.isFalse(hasShadow(waterfall), 'shadow is display:none'); |
| 133 }); |
| 134 |
| 135 test('no shadow in waterfall-tall mode', function() { |
| 136 assert.isFalse(hasShadow(waterfallTall), 'shadow is display:none'); |
| 137 }); |
| 138 |
| 139 test('no shadow in scroll mode', function() { |
| 140 assert.isFalse(hasShadow(scroll), 'shadow is display:none'); |
| 141 }); |
| 142 |
| 143 test('no shadow in cover mode', function() { |
| 144 assert.isFalse(hasShadow(cover), 'shadow is display:none'); |
| 145 }); |
| 146 |
| 147 test('shadow property forces shadow to show', function() { |
| 148 assert.isTrue(hasShadow(seamedShadow), 'shadow has display'); |
| 149 }); |
| 150 |
| 151 }); |
| 152 |
| 153 </script> |
| 154 |
| 155 </body> |
| 156 </html> |
| OLD | NEW |