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.
7 <link rel='import' href='../ct-unexpected-failures.html'>
9 <link rel="import" href="../../model/ct-commit-list.html">
10 <link rel="import" href="../../model/ct-failures.html">
15 var assert = chai.assert;
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'));
26 it('test showing partytime with no failures for the selected tree', function(done) {
27 var noFailuresForTree = document.createElement('ct-unexpected-failures');
28 noFailuresForTree.failures = new CTFailures(new CTCommitList(undefined, []));
29 noFailuresForTree.failures.failures = {
30 othertree: [new CTStepFailure('step', 'reason', [])]
32 noFailuresForTree.tree = 'mocktree';
34 setTimeout(function() {
35 assert.ok(noFailuresForTree.shadowRoot.querySelector('ct-party-time'));
40 it('test showing partytime with no failures in this tree\'s list', function(done) {
41 var noFailuresByLength = document.createElement('ct-unexpected-failures');
42 noFailuresByLength.failures = new CTFailures(new CTCommitList(undefined, []));
43 noFailuresByLength.failures.failures = {
46 noFailuresByLength.tree = 'mocktree';
48 setTimeout(function() {
49 assert.ok(noFailuresByLength.shadowRoot.querySelector('ct-party-time'));
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 CTStepFailure('step', 'reason', [])]
60 hasFailures.tree = 'mocktree';
62 setTimeout(function() {
63 assert.notOk(hasFailures.shadowRoot.querySelector('ct-party-time'));