Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1035)

Unified Diff: Tools/GardeningServer/model/test/ct-failure-group-tests.html

Issue 476903003: Add a "Link Bug" button to associate a bug with a failure (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebasd Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/GardeningServer/model/ct-failure-group.html ('k') | Tools/GardeningServer/run-unittests.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/model/test/ct-failure-group-tests.html
diff --git a/Tools/GardeningServer/model/test/ct-failure-group-tests.html b/Tools/GardeningServer/model/test/ct-failure-group-tests.html
index 79cd0cbf1990018ea08f08453d9ce11ced3fd0f3..83285496e9dd85c510fbdff2cc42a66cc38d1159 100644
--- a/Tools/GardeningServer/model/test/ct-failure-group-tests.html
+++ b/Tools/GardeningServer/model/test/ct-failure-group-tests.html
@@ -51,24 +51,51 @@ describe('ct-failure-group', function() {
});
});
+ describe('setBug', function() {
+ it('should store the bug', function(done) {
+ var group = new CTFailureGroup('key', []);
+ group.setBug('123').then(function() {
+ assert.equal(group.bug, 'http://crbug.com/123');
+ assert.equal(group._annotation.bug, 'http://crbug.com/123');
+ assert.equal(group.bugLabel, 'Bug 123');
+ done();
+ });
+ });
+
+ it('should support URLs', function(done) {
+ var group = new CTFailureGroup('key', []);
+ group.setBug('http://foobar.com/?id=876&x=y').then(function() {
+ assert.equal(group.bug, 'http://foobar.com/?id=876&x=y');
+ assert.equal(group._annotation.bug, 'http://foobar.com/?id=876&x=y');
+ assert.equal(group.bugLabel, 'Bug 876');
+ done();
+ });
+ });
+ });
+
describe('annotations', function() {
it('should have sensible defaults', function() {
var group = new CTFailureGroup('key', []);
- assert.deepEqual(group.annotation, {});
+ assert.deepEqual(group._annotation, {});
assert.isFalse(group.isSnoozed);
+ assert.isUndefined(group.bug);
+ assert.isUndefined(group.bugLabel);
});
it('should compute properties', function() {
- var group = new CTFailureGroup('key', [], {snoozeTime: Date.now() + 1000 * 1000});
+ var group = new CTFailureGroup('key', [], {snoozeTime: Date.now() + 1000 * 1000, bug: 'http://crbug.com/123'});
assert.isTrue(group.isSnoozed);
+ assert.equal(group.bug, 'http://crbug.com/123');
});
it('should be persisted', function(done) {
var group = new CTFailureGroup('key', []);
group.snoozeUntil(123).then(function() {
- CTFailureGroup.fetchAnnotations().then(function(annotations) {
- assert.deepEqual(annotations['key'], {snoozeTime: 123});
- done();
+ group.setBug('456').then(function() {
+ CTFailureGroup.fetchAnnotations().then(function(annotations) {
+ assert.deepEqual(annotations['key'], {snoozeTime: 123, bug: 'http://crbug.com/456'});
+ done();
+ });
});
});
});
« no previous file with comments | « Tools/GardeningServer/model/ct-failure-group.html ('k') | Tools/GardeningServer/run-unittests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698