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

Unified Diff: Tools/GardeningServer/ui/test/ct-trooper-card-tests.html

Issue 476903004: [sheriff-o-matic]: Basic trooper display for sheriff-o-matic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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-tree-status-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-trooper-card-tests.html
diff --git a/Tools/GardeningServer/ui/test/ct-trooper-card-tests.html b/Tools/GardeningServer/ui/test/ct-trooper-card-tests.html
new file mode 100644
index 0000000000000000000000000000000000000000..695f95d1694a31de18bcf8f0fb59157ca20fdfd0
--- /dev/null
+++ b/Tools/GardeningServer/ui/test/ct-trooper-card-tests.html
@@ -0,0 +1,62 @@
+<!--
+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-trooper-card.html">
+
+<link rel="import" href="../../model/ct-trooper-failure-group-data.html">
+
+<script>
+(function () {
+
+var assert = chai.assert;
+
+describe('ct-trooper-card', function() {
+
+ var card;
+
+ beforeEach(function(done) {
+ card = document.createElement('ct-trooper-card');
+ setTimeout(done);
+ });
+
+ it('creates a chart for cq_latency data types', function(done) {
+ var data = new CTTrooperFailureGroupData('detail', 'url', {p50: 0, p90: 0}, 'cq_latency', 'blink');
+ card.group = data;
+ var chart = card.querySelector('::shadow ct-chart::shadow #chart');
+ var initialState = chart.toDataURL();
+ var initialChildren = chart.children.length;
+ setTimeout(function() {
+ assert(chart.toDataURL() != initialState, "setting card data didn't update chart");
+ done();
+ });
+ });
+
+ it('creates a chart for tree_status data types', function(done) {
+ var data = new CTTrooperFailureGroupData('detail', 'url', {percent_open: 0}, 'tree_status', 'blink');
+ card.group = data;
+ var chart = card.querySelector('::shadow ct-chart::shadow #chart');
+ var initialState = chart.toDataURL();
+ setTimeout(function() {
+ assert(chart.toDataURL() != initialState, "setting card data didn't update chart");
+ done();
+ });
+ });
+
+ it('creates a chart for cycle_time data types', function(done) {
+ var data = new CTTrooperFailureGroupData('detail', 'url', {percent_over_median_slo: '0%', percent_over_max_slo: '0%'},
+ 'cycle_time', 'blink');
+ card.group = data;
+ var chart = card.querySelector('::shadow ct-chart::shadow #chart');
+ var initialState = chart.toDataURL();
+ setTimeout(function() {
+ assert(chart.toDataURL() != initialState, "setting card data didn't update chart");
+ done();
+ });
+ });
+});
+
+})();
+</script>
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-tree-status-tests.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698