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 with no CTFailures', function(done) { |
| 19 var noFailures = document.createElement('ct-unexpected-failures'); |
| 20 setTimeout(function() { |
| 21 assert.notOk(noFailures.shadowRoot.querySelector('ct-party-time')); |
| 22 done(); |
| 23 }); |
| 24 }); |
| 25 |
| 26 it('test showing partytime with no failures for the selected tree', function(d
one) { |
| 27 var noFailuresForTree = document.createElement('ct-unexpected-failures'); |
| 28 noFailuresForTree.failures = new CTFailures(new CTCommitList(undefined, []))
; |
| 29 noFailuresForTree.failures.failures = { |
| 30 othertree: [new CTFailure('step', 'reason', [])] |
| 31 }; |
| 32 noFailuresForTree.tree = 'mocktree'; |
| 33 |
| 34 setTimeout(function() { |
| 35 assert.ok(noFailuresForTree.shadowRoot.querySelector('ct-party-time')); |
| 36 done(); |
| 37 }); |
| 38 }); |
| 39 |
| 40 it('test showing partytime with no failures in this tree\'s list', function(do
ne) { |
| 41 var noFailuresByLength = document.createElement('ct-unexpected-failures'); |
| 42 noFailuresByLength.failures = new CTFailures(new CTCommitList(undefined, [])
); |
| 43 noFailuresByLength.failures.failures = { |
| 44 mocktree: [] |
| 45 }; |
| 46 noFailuresByLength.tree = 'mocktree'; |
| 47 |
| 48 setTimeout(function() { |
| 49 assert.ok(noFailuresByLength.shadowRoot.querySelector('ct-party-time')); |
| 50 done(); |
| 51 }); |
| 52 }); |
| 53 |
| 54 it('test showing partytime with failures for this tree', function(done) { |
| 55 var hasFailures = document.createElement('ct-unexpected-failures'); |
| 56 hasFailures.failures = new CTFailures(new CTCommitList(undefined, [])); |
| 57 hasFailures.failures.failures = { |
| 58 mocktree: [new CTFailure('step', 'reason', [])] |
| 59 }; |
| 60 hasFailures.tree = 'mocktree'; |
| 61 |
| 62 setTimeout(function() { |
| 63 assert.notOk(hasFailures.shadowRoot.querySelector('ct-party-time')); |
| 64 |
| 65 done(); |
| 66 }); |
| 67 }); |
| 68 }); |
| 69 |
| 70 })(); |
| 71 </script> |
OLD | NEW |