OLD | NEW |
| (Empty) |
1 <!-- | |
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 | |
4 found in the LICENSE file. | |
5 --> | |
6 | |
7 <link rel="import" href="../ct-builder-failure-card.html"> | |
8 | |
9 <link rel="import" href="../../model/ct-failure-group.html"> | |
10 | |
11 <script> | |
12 (function () { | |
13 | |
14 var assert = chai.assert; | |
15 | |
16 describe('ct-builder-failure-card', function() { | |
17 var group; | |
18 var card; | |
19 var failure; | |
20 | |
21 beforeEach(function(done) { | |
22 card = document.createElement('ct-builder-failure-card'); | |
23 group = new CTFailureGroup('blink', new CTBuilderFailureGroupData( | |
24 new CTBuilderFailure('blink', 'https://build.chromium.org/p/chromium.web
kit', | |
25 'Linux (dbg)', 'building', 7200, 5), "Linux (dbg)", "http://foo.bar"
)); | |
26 card.group = group.data; | |
27 card.commitLog = new CTCommitLogMock(); | |
28 setTimeout(done); | |
29 }); | |
30 | |
31 describe('failure card UI', function() { | |
32 | |
33 it('should rename building to running.', function(done) { | |
34 var text = card.shadowRoot.querySelectorAll('div')[0].textContent; | |
35 | |
36 assert(text.search('running') != -1); | |
37 assert(text.search('building') == -1); | |
38 done(); | |
39 }); | |
40 | |
41 it('should display the correct values.', function(done) { | |
42 var text = card.shadowRoot.textContent; | |
43 | |
44 assert(text.search('2.00 hours') != -1); | |
45 assert(text.search('5 pending builds') != -1); | |
46 done(); | |
47 }); | |
48 | |
49 }); | |
50 | |
51 }); | |
52 | |
53 })() | |
54 </script> | |
OLD | NEW |