Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!-- | |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | |
| 4 that can be found in the LICENSE file. | |
| 5 --> | |
| 6 | |
| 7 <!doctype html> | |
| 8 <html lang="en"> | |
| 9 <head> | |
| 10 <meta charset="utf-8"> | |
| 11 <meta name="viewport" content="width=device-width, minimum-scale=1, initial- scale=1, user-scalable=yes"> | |
| 12 | |
| 13 <title>config-set test</title> | |
| 14 | |
| 15 <script src="../../bower_components/webcomponentsjs/webcomponents-lite.js">< /script> | |
| 16 <script src="../../bower_components/web-component-tester/browser.js"></scrip t> | |
| 17 | |
| 18 <link rel="import" href="../../src/config-ui/config-set.html"> | |
| 19 </head> | |
| 20 <body> | |
| 21 | |
| 22 <test-fixture id="projects/infra-experimental"> | |
|
Sergey Berezin
2017/06/28 19:11:35
nit: we usually try to avoid having actual product
ayanaadylova
2017/07/05 18:02:45
Done.
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 23 <template> | |
| 24 <config-set category="projects" | |
| 25 name="infra-experimental"></config-set> | |
| 26 </template> | |
| 27 </test-fixture> | |
| 28 | |
| 29 <test-fixture id="projects/infra-experimental/refs/heads/master"> | |
| 30 <template> | |
| 31 <config-set category="projects" | |
| 32 name="infra-experimental/refs/heads/master"></config-set> | |
| 33 </template> | |
| 34 </test-fixture> | |
| 35 | |
| 36 <script> | |
| 37 suite('<config-set>', function() { | |
| 38 var config_set; | |
| 39 setup(function() { | |
| 40 config_set = fixture('projects/infra-experimental'); | |
| 41 }); | |
| 42 | |
| 43 test('checks the category of config set', function() { | |
|
Sergey Berezin
2017/06/28 19:11:35
nit: it's a good practice to name suites and tests
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 44 assert.equal(config_set.category, 'projects'); | |
| 45 }); | |
| 46 | |
| 47 test('checks the name of config set', function() { | |
| 48 assert.equal(config_set.name, 'infra-experimental'); | |
| 49 }); | |
| 50 | |
| 51 test('checks that isLoading property is true by default', function() { | |
| 52 assert.equal(config_set.isLoading, true); | |
| 53 }); | |
| 54 | |
| 55 test('gets iron-ajax response', function () { | |
| 56 var ajax = config_set.shadowRoot.querySelector('iron-ajax'); | |
| 57 ajax.generateRequest(); | |
| 58 ajax.addEventListener('response', function() { | |
| 59 assert.equal(config_set.isLoading, false); | |
| 60 assert.equal(config_set.files.length, 11); | |
| 61 assert.equal(config_set.lastImportAttempt.success, true); | |
| 62 assert.notEqual(config_set.location, ""); | |
| 63 }); | |
| 64 }); | |
| 65 | |
| 66 }); | |
| 67 | |
| 68 suite('<config-set>', function() { | |
|
Sergey Berezin
2017/06/28 19:11:35
Should the suite names be different?
The two test
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 69 var config_set; | |
| 70 setup(function() { | |
| 71 config_set = fixture('projects/infra-experimental/refs/heads/master'); | |
| 72 }); | |
| 73 | |
| 74 test('checks the category of config set', function() { | |
| 75 assert.equal(config_set.category, 'projects'); | |
| 76 }); | |
| 77 | |
| 78 test('checks the name of config set', function() { | |
| 79 assert.equal(config_set.name, 'infra-experimental/refs/heads/master'); | |
| 80 }); | |
| 81 | |
| 82 test('checks that isLoading property is true by default', function() { | |
| 83 assert.equal(config_set.isLoading, true); | |
| 84 }); | |
| 85 | |
| 86 test('gets iron-ajax response', function () { | |
| 87 var ajax = config_set.shadowRoot.querySelector('iron-ajax'); | |
| 88 ajax.generateRequest(); | |
| 89 ajax.addEventListener('response', function() { | |
| 90 assert.equal(config_set.isLoading, false); | |
| 91 assert.equal(config_set.files.length, 0); | |
|
Sergey Berezin
2017/06/28 19:11:35
nit: it would be interesting to generate a few fil
ayanaadylova
2017/07/06 22:51:43
Done.
| |
| 92 assert.equal(config_set.lastImportAttempt.success, true); | |
| 93 assert.notEqual(config_set.location, ""); | |
| 94 }); | |
| 95 }); | |
| 96 | |
| 97 }); | |
| 98 | |
| 99 </script> | |
| 100 </body> | |
| 101 </html> | |
| OLD | NEW |