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-builder.html"> | 7 <link rel="import" href="../ct-builder.html"> |
8 | 8 |
9 <script> | 9 <script> |
10 (function () { | 10 (function () { |
11 | 11 |
12 var assert = chai.assert; | 12 var assert = chai.assert; |
13 | 13 |
14 describe('ct-builder', function() { | 14 describe('ct-builder', function() { |
15 var builder; | 15 var builder; |
| 16 var masterUrl = 'http://url'; |
| 17 var builderName = 'WebKit Linux (dbg)'; |
| 18 var firstFailingBuild = '1234'; |
16 | 19 |
17 beforeEach(function(done) { | 20 beforeEach(function(done) { |
18 builder = document.createElement('ct-builder'); | 21 builder = document.createElement('ct-builder'); |
19 builder.builder = 'WebKit Linux (dbg)'; | 22 builder.builder = new CTBuilder(masterUrl, builderName, firstFailingBuild); |
20 requestAnimationFrame(function() { done(); }); | 23 |
| 24 setTimeout(done); |
21 }); | 25 }); |
22 | 26 |
23 describe('default builder UI', function() { | 27 describe('default builder UI', function() { |
24 it('should link to the builder', function() { | 28 it('should link to the builder', function() { |
25 var a = builder.shadowRoot.querySelector('a'); | 29 var a = builder.shadowRoot.querySelector('a'); |
26 assert.ok(a.href); | |
27 assert.include(a.href, 'WebKit+Linux+(dbg)'); | |
28 }); | |
29 }); | |
30 | |
31 describe('builder UI with steps', function() { | |
32 beforeEach(function(done) { | |
33 builder.steps = ['gclient_revert', 'compile', 'unittests']; | |
34 requestAnimationFrame(function() { done(); }); | |
35 }); | |
36 | |
37 it('should link to builder and show steps', function() { | |
38 var a = builder.shadowRoot.querySelector('a'); | |
39 assert.ok(a); | 30 assert.ok(a); |
40 assert.include(a.href, 'WebKit+Linux+(dbg)'); | 31 assert(a.href.startsWith(masterUrl)); |
41 assert.include(a.innerText, 'gclient_revert, compile, unittests'); | 32 assert.include(a.href, encodeURIComponent(builderName)); |
| 33 assert.include(a.href, firstFailingBuild); |
42 }); | 34 }); |
43 }); | 35 }); |
44 }); | 36 }); |
45 | 37 |
46 })() | 38 })() |
47 </script> | 39 </script> |
OLD | NEW |