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

Unified Diff: Tools/GardeningServer/ui/test/ct-failure-stream-tests.html

Issue 565523002: [Sheriff-o-matic] Refactor cards and get rid of ct-failure-cards (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed Created 6 years, 3 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/ui/test/ct-failure-card-tests.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/ui/test/ct-failure-stream-tests.html
diff --git a/Tools/GardeningServer/ui/test/ct-failure-stream-tests.html b/Tools/GardeningServer/ui/test/ct-failure-stream-tests.html
index fe04a174a60acf4d3dfa2d23466447010fc3b43e..c9714882340181d01c0b53bdefcb00c331fcae94 100644
--- a/Tools/GardeningServer/ui/test/ct-failure-stream-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-failure-stream-tests.html
@@ -30,7 +30,7 @@ describe('ct-failure-stream', function() {
new CTFailureGroup('', new CTSheriffFailureGroupData([]))];
stream.category = 'default';
setTimeout(function() {
- var cards = stream.shadowRoot.querySelectorAll('ct-failure-card');
+ var cards = stream.shadowRoot.querySelectorAll('ct-bot-failure-card');
assert.equal(cards.length, 2);
done();
});
@@ -38,18 +38,49 @@ describe('ct-failure-stream', function() {
});
describe('category', function() {
+
it('should only show failure groups for the specified category', function(done) {
var failures = [new CTFailure('step', 'reason', [{key: 'a', annotation: {snoozeTime: Date.now() + 1000 * 1000}}])];
var snoozed = new CTFailureGroup('', new CTSheriffFailureGroupData(failures));
stream.groups = [new CTFailureGroup('', new CTSheriffFailureGroupData([])), snoozed];
stream.category = 'snoozed';
setTimeout(function() {
- var cards = stream.shadowRoot.querySelectorAll('ct-failure-card');
+ var cards = stream.shadowRoot.querySelectorAll('ct-bot-failure-card');
assert.equal(cards.length, 1);
- assert.equal(cards[0].group, snoozed);
+ assert.equal(cards[0].group, snoozed.data);
done();
});
});
+
+ it('should select the correct card type', function(done) {
+ var failures = [new CTFailure('step', 'reason', [{key: 'a', annotation: {}}])];
+ var failureGroup = new CTFailureGroup('', new CTSheriffFailureGroupData(failures));
+ stream.groups = [new CTFailureGroup('', new CTSheriffFailureGroupData([])), failureGroup];
+ stream.category = 'default';
+ setTimeout(function() {
+ assert(stream.shadowRoot.querySelector('ct-bot-failure-card') != null,
+ 'missing sheriff card');
+ stream.groups = [new CTFailureGroup('', new CTTrooperFailureGroupData(
+ 'details', 'url', {percent_over_median_slo: '6%',
+ percent_over_max_slo: '7%'}, 'cq_latency', ''))];
+ setTimeout(function() {
+ assert(stream.shadowRoot.querySelector('ct-trooper-card') != null,
+ 'missing cq-latency card');
+ stream.groups[0].data.type = 'tree_status';
+ setTimeout(function() {
+ assert(stream.shadowRoot.querySelector('ct-trooper-card') !=
+ null, 'missing tree-status card');
+ stream.groups[0].data.type = 'cycle_time';
+ setTimeout(function() {
+ assert(stream.shadowRoot.querySelector('ct-trooper-card') !=
+ null, 'missing cycle-time card');
+ done();
+ });
+ });
+ });
+ });
+ });
+
});
});
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-failure-card-tests.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698