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 () { |
11 | 11 |
12 var assert = chai.assert; | 12 var assert = chai.assert; |
13 | 13 |
14 describe('ct-failure-group', function() { | 14 describe('ct-failure-group', function() { |
15 | 15 |
16 beforeEach(function() { | 16 beforeEach(function() { |
17 localStorage.removeItem('CTFailureGroupAnnotations'); | 17 localStorage.removeItem('CTFailureGroupAnnotations'); |
18 }); | 18 }); |
19 | 19 |
| 20 describe('category', function() { |
| 21 it('should be "default" by default', function() { |
| 22 var group = new CTFailureGroup('key', []); |
| 23 assert.equal(group.category, 'default'); |
| 24 }); |
| 25 |
| 26 it('should be "snoozed" when snoozed', function() { |
| 27 var group = new CTFailureGroup('key', [], {snoozeTime: Date.now() + 1000 *
1000}); |
| 28 assert.equal(group.category, 'snoozed'); |
| 29 }); |
| 30 }); |
| 31 |
20 describe('snooze', function() { | 32 describe('snooze', function() { |
21 it('should set isSnoozed', function(done) { | 33 it('should set isSnoozed', function(done) { |
22 var group = new CTFailureGroup('key', []); | 34 var group = new CTFailureGroup('key', []); |
23 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { | 35 group.snoozeUntil(Date.now() + 1000 * 1000).then(function() { |
24 assert.isTrue(group.isSnoozed); | 36 assert.isTrue(group.isSnoozed); |
25 done(); | 37 done(); |
26 }); | 38 }); |
27 }); | 39 }); |
28 }); | 40 }); |
29 | 41 |
(...skipping 28 matching lines...) Expand all Loading... |
58 assert.deepEqual(annotations['key'], {snoozeTime: 123}); | 70 assert.deepEqual(annotations['key'], {snoozeTime: 123}); |
59 done(); | 71 done(); |
60 }); | 72 }); |
61 }); | 73 }); |
62 }); | 74 }); |
63 }); | 75 }); |
64 }); | 76 }); |
65 | 77 |
66 })() | 78 })() |
67 </script> | 79 </script> |
OLD | NEW |