OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="../ct-failure-card.html"> | 7 <link rel="import" href="../ct-failure-card.html"> |
8 | 8 |
9 <link rel="import" href="../../model/ct-commit-log-mock.html"> | 9 <link rel="import" href="../../model/ct-commit-log-mock.html"> |
10 <link rel="import" href="../../model/ct-failure-group.html"> | 10 <link rel="import" href="../../model/ct-failure-group.html"> |
11 | 11 |
12 <script> | 12 <script> |
13 (function () { | 13 (function () { |
14 | 14 |
15 var assert = chai.assert; | 15 var assert = chai.assert; |
16 | 16 |
17 describe('ct-failure-card', function() { | 17 describe('ct-failure-card', function() { |
18 var group; | 18 var group; |
19 var card; | 19 var card; |
20 | 20 |
21 beforeEach(function(done) { | 21 beforeEach(function(done) { |
22 card = document.createElement('ct-failure-card'); | 22 card = document.createElement('ct-failure-card'); |
23 group = new CTFailureGroup('key', [ | 23 group = new CTFailureGroup('key', [ |
24 new CTFailure('autobot', 'unknown', {}, {'blink':158547}, | 24 new CTFailure('autobot', 'unknown', {})], ['blink:158544', 'blink:158545
']); |
25 {'blink':158544})]); | |
26 card.group = group; | 25 card.group = group; |
27 card.commitLog = new CTCommitLogMock(); | 26 card.commitLog = new CTCommitLogMock(); |
28 setTimeout(done); | 27 setTimeout(done); |
29 }); | 28 }); |
30 | 29 |
31 describe('failure card UI', function() { | 30 describe('failure card UI', function() { |
32 | 31 |
33 it('should have commit summaries', function(done) { | 32 it('should have commit summaries', function(done) { |
34 // Expand the first repository so that the <ct-commit>'s are generated. | 33 // Expand the first repository so that the <ct-commit>'s are generated. |
35 card._commitList.repositories[0].expanded = true; | 34 card._commitList.repositories[0].expanded = true; |
36 | 35 |
37 setTimeout(function() { | 36 setTimeout(function() { |
38 var list = card.shadowRoot.querySelector('ct-commit-list'); | 37 var list = card.shadowRoot.querySelector('ct-commit-list'); |
39 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | 38 var commits = list.shadowRoot.querySelectorAll('ct-commit'); |
40 assert(commits[0].data); | 39 assert(commits[1].data); |
41 assert(commits[0].data.summary); | 40 assert(commits[1].data.summary); |
42 done(); | 41 done(); |
43 }); | 42 }); |
44 }); | 43 }); |
45 | 44 |
46 it('removing a commit summary', function(done) { | 45 it('removing a commit summary', function(done) { |
47 card.commitLog.commits['blink']['158545'].summary = undefined; | 46 card.commitLog.commits['blink']['158545'].summary = undefined; |
48 card._commitList.repositories[0].expanded = true; | 47 card._commitList.repositories[0].expanded = true; |
49 | 48 |
50 setTimeout(function() { | 49 setTimeout(function() { |
51 var list = card.shadowRoot.querySelector('ct-commit-list'); | 50 var list = card.shadowRoot.querySelector('ct-commit-list'); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 done(); | 126 done(); |
128 }); | 127 }); |
129 }); | 128 }); |
130 }); | 129 }); |
131 }); | 130 }); |
132 | 131 |
133 }); | 132 }); |
134 | 133 |
135 })() | 134 })() |
136 </script> | 135 </script> |
OLD | NEW |