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

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

Issue 455263002: Sheriff-o-matic: Display snoozed failure groups in a separate stream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ct-failure-stream-tests 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/ui/ct-unexpected-failures.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
new file mode 100644
index 0000000000000000000000000000000000000000..a34aefe321b1d2009275e24ce13474ef60cac05c
--- /dev/null
+++ b/Tools/GardeningServer/ui/test/ct-failure-stream-tests.html
@@ -0,0 +1,56 @@
+<!--
+Copyright 2014 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+
+<link rel="import" href="../ct-failure-stream.html">
+
+<script>
+(function () {
+
+var assert = chai.assert;
+
+describe('ct-failure-stream', function() {
+
+ var stream;
+
+ beforeEach(function(done) {
+ stream = document.createElement('ct-failure-stream');
+ setTimeout(done);
+ });
+
+ describe('default ui', function() {
+ it('should show failure groups', function(done) {
+ // FIXME: We should use some more interesting test data, but
+ // ct-failure-stream will give these values to ct-commit-data,
+ // which will hit the network unless we figure out how to mock
+ // out ct-commit-data in a better way.
+ stream.groups = [new CTFailureGroup('a', []), new CTFailureGroup('b', [])];
+ stream.category = 'default';
+ setTimeout(function() {
+ var cards = stream.shadowRoot.querySelectorAll('ct-failure-card');
+ assert.equal(cards.length, 2);
+ assert.equal(cards[0].group.key, 'a');
+ assert.equal(cards[1].group.key, 'b');
+ done();
+ });
+ });
+ });
+
+ describe('category', function() {
+ it('should only show failure groups for the specified category', function(done) {
+ stream.groups = [new CTFailureGroup('a', []), new CTFailureGroup('b', [], {snoozeTime: Date.now() + 1000 * 1000})];
+ stream.category = 'snoozed';
+ setTimeout(function() {
+ var cards = stream.shadowRoot.querySelectorAll('ct-failure-card');
+ assert.equal(cards.length, 1);
+ assert.equal(cards[0].group.key, 'b');
+ done();
+ });
+ });
+ });
+});
+
+})();
+</script>
« no previous file with comments | « Tools/GardeningServer/ui/ct-unexpected-failures.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698