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-unexpected-failures.html'> | |
8 | |
9 <link rel="import" href="../../model/ct-commit-list.html"> | |
10 <link rel="import" href="../../model/ct-failures.html"> | |
11 | |
12 <script> | |
13 (function () { | |
14 | |
15 var assert = chai.assert; | |
16 | |
17 describe('ct-unexpected-failures', function() { | |
18 it('test showing partytime', function(done) { | |
19 var noFailures = document.createElement('ct-unexpected-failures'); | |
20 | |
21 var noFailuresForTree = document.createElement('ct-unexpected-failures'); | |
22 noFailuresForTree.failures = new CTFailures(new CTCommitList(undefined, [])) ; | |
23 noFailuresForTree.failures.failures = { | |
24 othertree: [new CTFailure('step', 'reason', [])] | |
25 }; | |
26 noFailuresForTree.tree = 'mocktree'; | |
27 | |
28 var noFailuresByLength = document.createElement('ct-unexpected-failures'); | |
29 noFailuresByLength.failures = new CTFailures(new CTCommitList(undefined, []) ); | |
30 noFailuresByLength.failures.failures = { | |
31 mocktree: [] | |
32 }; | |
33 noFailuresByLength.tree = 'mocktree'; | |
34 | |
35 var failures = document.createElement('ct-unexpected-failures'); | |
36 failures.failures = new CTFailures(new CTCommitList(undefined, [])); | |
37 failures.failures.failures = { | |
Jeffrey Yasskin
2014/09/02 18:34:53
Hmmm. Can you avoid having the same name 3 deep?
ojan
2014/09/11 03:04:47
Changed the first one to hasFailures. I find I kee
| |
38 mocktree: [new CTFailure('step', 'reason', [])] | |
39 }; | |
40 failures.tree = 'mocktree'; | |
41 | |
42 setTimeout(function() { | |
43 assert.ok(noFailures.shadowRoot.querySelector('ct-party-time').partytime); | |
Jeffrey Yasskin
2014/09/02 18:34:53
Style-wise, I'd probably split this into 4 differe
ojan
2014/09/11 03:04:47
Done.
| |
44 assert.ok(noFailuresForTree.shadowRoot.querySelector('ct-party-time').part ytime); | |
45 assert.ok(noFailuresByLength.shadowRoot.querySelector('ct-party-time').par tytime); | |
46 assert.notOk(failures.shadowRoot.querySelector('ct-party-time').partytime) ; | |
47 | |
48 done(); | |
49 }); | |
50 }); | |
51 }); | |
52 | |
53 })(); | |
54 </script> | |
OLD | NEW |