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 17 matching lines...) Expand all Loading... |
28 it('should be "default" by default', function() { | 28 it('should be "default" by default', function() { |
29 var group = new CTFailureGroup('', new CTSheriffFailureGroupData([])); | 29 var group = new CTFailureGroup('', new CTSheriffFailureGroupData([])); |
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('', new CTSheriffFailureGroupData( | 34 var group = new CTFailureGroup('', new CTSheriffFailureGroupData( |
35 [newFailureWithAnnotation({snoozeTime: Date.now() + 1000 * 1000})])); | 35 [newFailureWithAnnotation({snoozeTime: Date.now() + 1000 * 1000})])); |
36 assert.equal(group.category, 'snoozed'); | 36 assert.equal(group.category, 'snoozed'); |
37 }); | 37 }); |
| 38 |
| 39 it('should be "failedOnce" when there is only one failure', function() { |
| 40 var failure = newFailureWithAnnotation(); |
| 41 failure.resultNodesByBuilder = {some_key: {failingBuildCount: 1}} |
| 42 var group = new CTFailureGroup('', new CTSheriffFailureGroupData( |
| 43 [failure])); |
| 44 assert.equal(group.category, 'failedOnce'); |
| 45 }); |
| 46 |
| 47 it('should not be "failedOnce" when there is more than one failure', functio
n() { |
| 48 var failure = newFailureWithAnnotation(); |
| 49 failure.resultNodesByBuilder = {some_key: {failingBuildCount: 1}, |
| 50 other_key: {failingBuildCount: 1}} |
| 51 var group = new CTFailureGroup('', new CTSheriffFailureGroupData( |
| 52 [failure])); |
| 53 assert.equal(group.category, 'default'); |
| 54 }); |
38 }); | 55 }); |
39 | 56 |
40 describe('snooze', function() { | 57 describe('snooze', function() { |
41 it('should set isSnoozed', function(done) { | 58 it('should set isSnoozed', function(done) { |
42 var group = new CTFailureGroup('', new CTSheriffFailureGroupData([newFailu
reWithAnnotation()])); | 59 var group = new CTFailureGroup('', new CTSheriffFailureGroupData([newFailu
reWithAnnotation()])); |
43 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { | 60 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { |
44 assert.isTrue(group.isSnoozed); | 61 assert.isTrue(group.isSnoozed); |
45 done(); | 62 done(); |
46 }); | 63 }); |
47 }); | 64 }); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 done(); | 188 done(); |
172 }); | 189 }); |
173 }); | 190 }); |
174 }); | 191 }); |
175 }); | 192 }); |
176 }); | 193 }); |
177 }); | 194 }); |
178 | 195 |
179 })() | 196 })() |
180 </script> | 197 </script> |
OLD | NEW |