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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <link rel="import" href="../ct-failure-card.html">
8
9 <link rel="import" href="../../model/ct-failure-group.html">
10
11 <script>
12 (function () {
13
14 var assert = chai.assert;
15
16 describe('ct-failure-group', function() {
17 var group;
18 var card;
19
20 beforeEach(function(done) {
21 card = document.createElement('ct-failure-card');
22 group = new CTFailureGroup('key', []);
23 card.group = group;
24 setTimeout(done);
25 });
26
27 describe('failure group UI', function(done) {
28 it('examine should dispatch event', function() {
29 card.addEventListener('ct-examine-failures', function(event) {
30 assert.deepEqual(event.detail.failures, []);
31 setTimeout(done);
32 });
33
34 card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('t ap'));
35 });
36
37 it('adding a bug number should show link', function(done) {
38 group.setBug(123);
39
40 setTimeout(function() {
41 var links = card.shadowRoot.querySelectorAll('a');
42 assert.lengthOf(links, 1);
43 assert.match(links[0].href, /crbug.com\/123/);
44 setTimeout(done);
45 });
46 });
47
48 it('should not show link without a bug number', function() {
49 var links = card.shadowRoot.querySelectorAll('a');
50 assert.lengthOf(links, 0);
51 });
52
53 it('clicking link bug should show dialog', function(done) {
54 card.shadowRoot.getElementById('link-bug').dispatchEvent(new CustomEvent(' tap'));
55 setTimeout(function() {
56 var dialog = card.shadowRoot.getElementById('bugDialog');
57 assert.isTrue(dialog.opened);
58 var bugField = card.shadowRoot.getElementById('bugNumber');
59 bugField.value = '999';
60 card.shadowRoot.getElementById('dialogOK').dispatchEvent(new CustomEvent ('tap'));
61 setTimeout(function() {
62 assert.equal(group.annotation.bugNumber, 999);
63 setTimeout(done);
64 });
65 });
66 });
67 });
68
69 });
70
71 })()
72 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698