Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: go/src/infra/appengine/sheriff-o-matic/test/som-bug-queue-test.html

Issue 2053893002: [som] Add bug queue UI. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: error handler Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <script src="/bower_components/webcomponentsjs/webcomponents.min.js"></script>
4 <script src="/bower_components/web-component-tester/browser.js"></script>
5 <link rel="import" href="/bower_components/iron-test-helpers/iron-test-helpers.h tml">
6 <link rel="import" href="/elements/som-bug-queue.html">
7 <test-fixture id="basic">
8 <template>
9 <som-bug-queue></som-bug-queue>
10 </template>
11 </test-fixture>
12 <script>
13 (function() {
14 'use strict';
15
16 suite('basic tests', function() {
17 var element;
18 var server;
19 var responseHeaders = {
20 json: { 'Content-Type': 'application/json' },
martiniss 2016/06/10 21:11:29 nit: no spaces around the strings, so {'Content...
seanmccullough1 2016/06/10 21:23:27 Done.
21 };
22
23 setup(function() {
24 element = fixture('basic');
25 server = sinon.fakeServer.create();
26 });
27
28 teardown(function() {
29 server.restore();
30 });
31
32 test('_haveNoBugs', function() {
33 assert.equal(true, element._haveNoBugs());
34 assert.equal(true, element._haveNoBugs({}));
35 assert.equal(true, element._haveNoBugs({items:[]}));
martiniss 2016/06/10 21:11:29 test false as well?
seanmccullough1 2016/06/10 21:23:27 Done.
36 });
37
38 test('renders empty', function(done) {
39 assert.equal(true, element.$.main.hidden);
40 element._bugQueueJson = {};
41 assert.equal(true, element._haveNoBugs(element._bugQueueJson));
42 flush( () => {
43 assert.equal(true, element.$.main.hidden);
44 done();
45 });
46 });
47
48 test('renders basic', function(done) {
49 assert.equal(true, element.$.main.hidden);
50 element._bugQueueJson = {
51 items: [
52 { summary: "foo", status: "bar", id: 123 },
53 { summary: "baz", status: "zippy", id: 456 },
54 ],
55 };
56
57 assert.equal(false, element._haveNoBugs(element._bugQueueJson));
58
59 flush( () => {
60 assert.equal(false, element.$.main.hidden);
61 assert.equal(2, element.$.main.querySelectorAll('.bug').length);
62 done();
63 });
64 });
65 });
66 })();
67 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698