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-commit.html"> | 7 <link rel="import" href="../ct-party-time.html"> |
8 | |
9 <link rel="import" href="../../model/ct-commit-mock.html"> | |
10 | 8 |
11 <script> | 9 <script> |
12 (function () { | 10 (function () { |
13 | 11 |
14 var assert = chai.assert; | 12 var assert = chai.assert; |
15 | 13 |
16 describe('ct-commit', function() { | 14 describe('ct-party-time', function() { |
17 var commit; | 15 var partyTime; |
| 16 var blinkFailures; |
18 | 17 |
19 beforeEach(function(done) { | 18 beforeEach(function(done) { |
20 commit = document.createElement('ct-commit'); | 19 partyTime = document.createElement('ct-party-time'); |
21 commit.data = new CTCommitMock(); | 20 |
| 21 partyTime.failures = { blink: blinkFailures }; |
| 22 partyTime.tree = 'blink'; |
22 | 23 |
23 setTimeout(done); | 24 setTimeout(done); |
24 }); | 25 }); |
25 | 26 |
26 describe('commit UI', function() { | 27 describe('party time: party', function() { |
27 it('should show example commit', function() { | 28 before(function() { |
28 var html = commit.shadowRoot.innerHTML; | 29 blinkFailures = []; |
| 30 }); |
29 | 31 |
30 assert.include(html, 'mkwst'); | 32 it('should have a party', function() { |
31 assert.include(html, 'behavior for these types'); | 33 assert(partyTime._partytime); |
32 assert.equal(commit.shadowRoot.querySelector('a').href, commit.data.url); | 34 }); |
| 35 }); |
| 36 |
| 37 describe('party time: no party', function() { |
| 38 before(function() { |
| 39 var resultsByBuilder = {}; |
| 40 blinkFailures = [new CTFailure("step1", "reason1", resultsByBuilder, 123,
123)]; |
| 41 }); |
| 42 |
| 43 it('should not have a party', function() { |
| 44 assert(!partyTime._partytime); |
33 }); | 45 }); |
34 }); | 46 }); |
35 }); | 47 }); |
36 | 48 |
37 })() | 49 })() |
38 </script> | 50 </script> |
OLD | NEW |