Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html lang="en"> | |
| 3 <head> | |
| 4 <meta charset="utf-8"> | |
| 5 <meta name="viewport" content="width=device-width, minimum-scale=1, initial- scale=1, user-scalable=yes"> | |
| 6 | |
| 7 <title>luci-config-ui test</title> | |
| 8 | |
| 9 <script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | |
| 10 <script src="../../../web-component-tester/browser.js"></script> | |
| 11 | |
| 12 <link rel="import" href="../../src/luci-config-ui/luci-config-ui.html"> | |
| 13 </head> | |
| 14 <body> | |
| 15 | |
| 16 <test-fixture id="BasicTestFixture"> | |
| 17 <template> | |
| 18 <luci-config-ui></luci-config-ui> | |
| 19 </template> | |
| 20 </test-fixture> | |
| 21 | |
| 22 <test-fixture id="ChangedPropertyTestFixture"> | |
| 23 <template> | |
| 24 <luci-config-ui prop1="new-prop1"></luci-config-ui> | |
| 25 </template> | |
| 26 </test-fixture> | |
| 27 | |
| 28 <script> | |
| 29 suite('luci-config-ui', function() { | |
| 30 | |
| 31 test('instantiating the element with default properties works', function () { | |
| 32 var element = fixture('BasicTestFixture'); | |
| 33 assert.equal(element.prop1, 'luci-config-ui'); | |
| 34 var elementShadowRoot = element.shadowRoot; | |
| 35 var elementHeader = elementShadowRoot.querySelector('h2'); | |
| 36 assert.equal(elementHeader.innerHTML, 'Hello luci-config-ui!'); | |
| 37 }); | |
| 38 | |
| 39 test('setting a property on the element works', function() { | |
| 40 // Create a test fixture | |
| 41 var element = fixture('ChangedPropertyTestFixture'); | |
| 42 assert.equal(element.prop1, 'new-prop1'); | |
| 43 var elementShadowRoot = element.shadowRoot; | |
| 44 var elementHeader = elementShadowRoot.querySelector('h2'); | |
| 45 assert.equal(elementHeader.innerHTML, 'Hello new-prop1!'); | |
|
Sergey Berezin (google)
2017/06/07 19:14:55
Does this pass? I don't see how the header in the
| |
| 46 }); | |
| 47 | |
| 48 }); | |
| 49 </script> | |
| 50 | |
| 51 | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |