Index: Tools/GardeningServer/ui/test/ct-failure-card-button-tests.html |
diff --git a/Tools/GardeningServer/ui/test/ct-failure-card-tests.html b/Tools/GardeningServer/ui/test/ct-failure-card-button-tests.html |
similarity index 62% |
rename from Tools/GardeningServer/ui/test/ct-failure-card-tests.html |
rename to Tools/GardeningServer/ui/test/ct-failure-card-button-tests.html |
index 5ca300f0ef313aad6b869e5b651a4a861045bbd1..8e676adc32f364c2c97fca9207bd0120e61335d7 100644 |
--- a/Tools/GardeningServer/ui/test/ct-failure-card-tests.html |
+++ b/Tools/GardeningServer/ui/test/ct-failure-card-button-tests.html |
@@ -4,7 +4,8 @@ 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="../ct-bot-failure-card.html"> |
+<link rel="import" href="../ct-failure-card-buttons.html"> |
<link rel="import" href="../../model/ct-commit-list-mock.html"> |
<link rel="import" href="../../model/ct-commit-log-mock.html"> |
@@ -15,71 +16,22 @@ found in the LICENSE file. |
var assert = chai.assert; |
-describe('ct-failure-card', function() { |
+describe('ct-failure-card-buttons', function() { |
var group; |
var card; |
var failures; |
beforeEach(function(done) { |
- card = document.createElement('ct-failure-card'); |
+ card = document.createElement('ct-failure-card-buttons'); |
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(); |
- }); |
- }); |
+ describe('failure card buttons', function() { |
it('examine should dispatch event', function(done) { |
card.addEventListener('ct-examine-failures', function(event) { |