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

Unified Diff: Tools/GardeningServer/ui/test/ct-failure-card-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/ui/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-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
new file mode 100644
index 0000000000000000000000000000000000000000..941f6b81e8e1d427789b2cd98440c0936c7f2071
--- /dev/null
+++ b/Tools/GardeningServer/ui/test/ct-failure-card-tests.html
@@ -0,0 +1,91 @@
+<!--
+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-failure-group.html">
+
+<script>
+(function () {
+
+var assert = chai.assert;
+
+describe('ct-failure-group', function() {
+ var group;
+ var card;
+
+ beforeEach(function(done) {
+ card = document.createElement('ct-failure-card');
+ group = new CTFailureGroup('key', []);
+ card.group = group;
+ setTimeout(done);
+ });
+
+ describe('failure group UI', function(done) {
+ it('examine should dispatch event', function() {
+ card.addEventListener('ct-examine-failures', function(event) {
+ assert.deepEqual(event.detail.failures, []);
+ setTimeout(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/);
+ setTimeout(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');
+ setTimeout(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');
+ setTimeout(done);
+ });
+ });
+ });
+ });
+
+});
+
+})()
+</script>
« no previous file with comments | « Tools/GardeningServer/ui/ct-failure-card-tests.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698