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

Unified Diff: Tools/GardeningServer/ui/test/ct-failure-card-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
Index: Tools/GardeningServer/ui/test/ct-failure-card-tests.html
diff --git a/Tools/GardeningServer/ui/test/ct-failure-card-tests.html b/Tools/GardeningServer/ui/test/ct-failure-card-tests.html
deleted file mode 100644
index 5ca300f0ef313aad6b869e5b651a4a861045bbd1..0000000000000000000000000000000000000000
--- a/Tools/GardeningServer/ui/test/ct-failure-card-tests.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!--
-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-card.html">
-
-<link rel="import" href="../../model/ct-commit-list-mock.html">
-<link rel="import" href="../../model/ct-commit-log-mock.html">
-<link rel="import" href="../../model/ct-failure-group.html">
-
-<script>
-(function () {
-
-var assert = chai.assert;
-
-describe('ct-failure-card', function() {
- var group;
- var card;
- var failures;
-
- beforeEach(function(done) {
- card = document.createElement('ct-failure-card');
- var cl = new CTCommitListMock();
- group = new CTFailureGroup('', new CTSheriffFailureGroupData([
- new CTFailure('autobot', 'unknown', {someBuilder: {key: 'a'}}, {'blink':158547},
- {'blink':158544})], cl));
- card.group = group;
- card.commitLog = new CTCommitLogMock();
- setTimeout(done);
- });
-
- describe('failure card UI', function() {
-
- it('should select the correct card type', function(done) {
- assert(card.shadowRoot.querySelector('ct-bot-failure-card') != null,
- 'missing sheriff card');
- card.group = new CTFailureGroup('', new CTTrooperFailureGroupData(
- 'details', 'url', {percent_over_median_slo: '6%',
- percent_over_max_slo: '7%'}, 'cq_latency', ''));
- setTimeout(function() {
- assert(card.shadowRoot.querySelector('ct-trooper-card') != null,
- 'missing cq-latency card');
- card.group.data.type = 'tree_status';
- setTimeout(function() {
- assert(card.shadowRoot.querySelector('ct-trooper-card') !=
- null, 'missing tree-status card');
- card.group.data.type = 'cycle_time';
- setTimeout(function() {
- assert(card.shadowRoot.querySelector('ct-trooper-card') !=
- null, 'missing cycle-time card');
- done();
- });
- });
- });
- });
-
- it('should have commit summaries', function(done) {
- // Expand the first repository so that the <ct-commit>'s are generated.
- card.group.data.commitList.repositories[0].expanded = true;
-
- setTimeout(function() {
- var list = card.shadowRoot.querySelector('::shadow ct-commit-list');
- var commits = list.shadowRoot.querySelectorAll('ct-commit');
- assert(commits[1].data);
- assert(commits[1].data.summary);
- done();
- });
- });
-
- it('removing a commit summary', function(done) {
- card.commitLog.commits['blink']['158545'].summary = undefined;
- card.group.data.commitList.repositories[0].expanded = true;
-
- setTimeout(function() {
- var list = card.shadowRoot.querySelector('::shadow ct-commit-list');
- var commits = list.shadowRoot.querySelectorAll('ct-commit');
- assert.notOk(commits[0].data.summary);
- done();
- });
- });
-
- it('examine should dispatch event', function(done) {
- card.addEventListener('ct-examine-failures', function(event) {
- assert.deepEqual(event.detail.failures, card.group.failures);
- done();
- });
-
- card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap'));
- });
-
- it('adding a bug number should show link', function(done) {
- group.setBug(123);
-
- setTimeout(function() {
- var links = card.shadowRoot.querySelectorAll('a');
- assert.lengthOf(links, 1);
- assert.match(links[0].href, /crbug.com\/123/);
- done();
- });
- });
-
- it('should not show link without a bug number', function() {
- var links = card.shadowRoot.querySelectorAll('a');
- assert.lengthOf(links, 0);
- });
-
- it('clicking link bug should show dialog', function(done) {
- card.shadowRoot.getElementById('link-bug').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- var dialog = card.shadowRoot.getElementById('bugDialog');
- assert.isTrue(dialog.opened);
- var bugField = card.shadowRoot.getElementById('bug');
- bugField.value = '999';
- card.shadowRoot.getElementById('dialogOk').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- assert.equal(group.bug, 'http://crbug.com/999');
- assert.equal(group.bugLabel, 'Bug 999');
- assert.equal(group._annotation.bug, 'http://crbug.com/999');
- done();
- });
- });
- });
-
- it('entering URLs should work for bugs', function(done) {
- card.shadowRoot.getElementById('link-bug').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- var dialog = card.shadowRoot.getElementById('bugDialog');
- assert.isTrue(dialog.opened);
- var bugField = card.shadowRoot.getElementById('bug');
- bugField.value = 'http://foo.com/?id=888';
- card.shadowRoot.getElementById('dialogOk').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- assert.equal(group.bug, 'http://foo.com/?id=888');
- assert.equal(group.bugLabel, 'Bug 888');
- assert.equal(group._annotation.bug, 'http://foo.com/?id=888');
- done();
- });
- });
- });
-
- it('remove bug link should work', function(done) {
- group.setBug(123);
- card.shadowRoot.getElementById('link-bug').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- var dialog = card.shadowRoot.getElementById('bugDialog');
- assert.isTrue(dialog.opened);
- card.shadowRoot.getElementById('dialogRemoveBug').dispatchEvent(new CustomEvent('tap'));
- setTimeout(function() {
- assert.isUndefined(group.bug);
- assert.isUndefined(group.bugLabel);
- done();
- });
- });
- });
- });
-
-});
-
-})()
-</script>

Powered by Google App Engine
This is Rietveld 408576698