Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | 2 Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <!doctype html> | 7 <!doctype html> |
| 8 <html lang="en"> | 8 <html lang="en"> |
| 9 <head> | 9 <head> |
| 10 <meta charset="utf-8"> | 10 <meta charset="utf-8"> |
| 11 <meta name="viewport" content="width=device-width, minimum-scale=1, initial- scale=1, user-scalable=yes"> | 11 <meta name="viewport" content="width=device-width, minimum-scale=1, initial- scale=1, user-scalable=yes"> |
| 12 | 12 |
| 13 <title>front-page test</title> | 13 <title>front-page test</title> |
| 14 | 14 |
| 15 <script src="../../bower_components/webcomponentsjs/webcomponents-lite.js">< /script> | 15 <script src="../../bower_components/webcomponentsjs/webcomponents-lite.js">< /script> |
| 16 <script src="../../bower_components/web-component-tester/browser.js"></scrip t> | 16 <script src="../../bower_components/web-component-tester/browser.js"></scrip t> |
| 17 | 17 |
| 18 <link rel="import" href="../../src/config-ui/front-page.html"> | 18 <link rel="import" href="../../src/config-ui/front-page.html"> |
| 19 </head> | 19 </head> |
| 20 <body> | 20 <body> |
| 21 | 21 |
| 22 <test-fixture id="front-pageTestFixture"> | 22 <test-fixture id="front-pageTestFixture"> |
| 23 <template> | 23 <template> |
| 24 <front-page></front-page> | 24 <front-page></front-page> |
| 25 </template> | 25 </template> |
| 26 </test-fixture> | 26 </test-fixture> |
| 27 | 27 |
| 28 <script> | 28 <script> |
| 29 suite('<front-page>', function() { | 29 suite('<front-page>', function() { |
| 30 // TODO(cwpayton): write tests for the front page element. | |
| 31 var front_page; | 30 var front_page; |
| 32 setup(function() { | 31 setup(function() { |
| 33 front_page = fixture('front-pageTestFixture'); | 32 front_page = fixture('front-pageTestFixture'); |
| 34 }); | 33 }); |
| 35 | 34 |
| 35 test('checks the config set list is empty before iron ajax call', | |
|
Sergey Berezin
2017/06/28 19:11:35
nit: same as above - consider naming the suite & t
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 36 function() { | |
| 37 assert.equal(front_page.configSetList.length, 0); | |
| 38 }); | |
| 39 | |
| 40 test('checks the search results list is empty before iron ajax call', | |
| 41 function() { | |
| 42 assert.equal(front_page.searchResults.length, 0); | |
| 43 }); | |
| 44 | |
| 45 test('checks that isLoading property is true by default', function() { | |
| 46 assert.equal(front_page.isLoading, true); | |
| 47 }); | |
| 48 | |
| 49 test('gets iron-ajax response', function () { | |
| 50 var ajax = front_page.shadowRoot.querySelector('iron-ajax'); | |
| 51 ajax.generateRequest(); | |
| 52 ajax.addEventListener('response', function() { | |
| 53 assert.equal(front_page.isLoading, false); | |
| 54 assert.deepEqual(front_page.configSetList, | |
| 55 front_page.searchResults); | |
|
Sergey Berezin
2017/06/28 19:11:35
How is configSetList generated in this test?
For
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 56 }); | |
| 57 }); | |
| 58 | |
| 36 }); | 59 }); |
| 37 </script> | 60 </script> |
| 38 </body> | 61 </body> |
| 39 </html> | 62 </html> |
| OLD | NEW |