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-failure-group.html"> | 7 <link rel="import" href="../ct-failure-group.html"> |
8 | 8 |
9 <script> | 9 <script> |
10 (function () { | 10 (function () { |
(...skipping 16 matching lines...) Expand all Loading... |
27 describe('category', function() { | 27 describe('category', function() { |
28 it('should be "default" by default', function() { | 28 it('should be "default" by default', function() { |
29 var group = new CTFailureGroup([], undefined); | 29 var group = new CTFailureGroup([], undefined); |
30 assert.equal(group.category, 'default'); | 30 assert.equal(group.category, 'default'); |
31 }); | 31 }); |
32 | 32 |
33 it('should be "snoozed" when snoozed', function() { | 33 it('should be "snoozed" when snoozed', function() { |
34 var group = new CTFailureGroup([newFailureWithAnnotation({snoozeTime: Date
.now() + 1000 * 1000})], undefined); | 34 var group = new CTFailureGroup([newFailureWithAnnotation({snoozeTime: Date
.now() + 1000 * 1000})], undefined); |
35 assert.equal(group.category, 'snoozed'); | 35 assert.equal(group.category, 'snoozed'); |
36 }); | 36 }); |
| 37 |
| 38 it('should be "failed_once" when there is only one failure', function() { |
| 39 var failure = newFailureWithAnnotation(); |
| 40 failure.resultNodesByBuilder = {some_key: {failingBuildCount: 1}} |
| 41 var group = new CTFailureGroup([failure], undefined); |
| 42 assert.equal(group.category, 'failed_once'); |
| 43 }); |
| 44 |
| 45 it('should not be "failed_once" when there is more than one failure', functi
on() { |
| 46 var failure = newFailureWithAnnotation(); |
| 47 failure.resultNodesByBuilder = {some_key: {failingBuildCount: 1}, |
| 48 other_key: {failingBuildCount: 1}} |
| 49 var group = new CTFailureGroup([failure], undefined); |
| 50 assert.equal(group.category, 'default'); |
| 51 }); |
37 }); | 52 }); |
38 | 53 |
39 describe('snooze', function() { | 54 describe('snooze', function() { |
40 it('should set isSnoozed', function(done) { | 55 it('should set isSnoozed', function(done) { |
41 var group = new CTFailureGroup([newFailureWithAnnotation()], undefined); | 56 var group = new CTFailureGroup([newFailureWithAnnotation()], undefined); |
42 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { | 57 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { |
43 assert.isTrue(group.isSnoozed); | 58 assert.isTrue(group.isSnoozed); |
44 done(); | 59 done(); |
45 }); | 60 }); |
46 }); | 61 }); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 done(); | 184 done(); |
170 }); | 185 }); |
171 }); | 186 }); |
172 }); | 187 }); |
173 }); | 188 }); |
174 }); | 189 }); |
175 }); | 190 }); |
176 | 191 |
177 })() | 192 })() |
178 </script> | 193 </script> |
OLD | NEW |