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

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

Issue 485253004: [Sheriff-o-matic] Remove race condition on the commit list. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: names 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
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
index 778f7eddd3a2688fda75da5590c15987a94ce42e..3cf951338390510b5806f5fecd24457945ffa248 100644
--- a/Tools/GardeningServer/ui/test/ct-failure-card-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-failure-card-tests.html
@@ -6,6 +6,7 @@ found in the LICENSE file.
<link rel="import" href="../ct-failure-card.html">
+<link rel="import" href="../../model/ct-commit-log-mock.html">
<link rel="import" href="../../model/ct-failure-group.html">
<script>
@@ -13,21 +14,50 @@ found in the LICENSE file.
var assert = chai.assert;
-describe('ct-failure-group', function() {
+describe('ct-failure-card', function() {
var group;
var card;
beforeEach(function(done) {
card = document.createElement('ct-failure-card');
- group = new CTFailureGroup('key', []);
+ group = new CTFailureGroup('key', [
+ new CTFailure('autobot', 'unknown', {}, {'blink':158547},
+ {'blink':158544})]);
card.group = group;
+ card.commitLog = new CTCommitLogMock();
setTimeout(done);
});
- describe('failure group UI', function() {
+ describe('failure card UI', function() {
+
+ it('should have commit summaries', function(done) {
+ // Expand the first repository so that the <ct-commit>'s are generated.
+ card._commitList.repositories[0].expanded = true;
+
+ setTimeout(function() {
+ var list = card.shadowRoot.querySelector('ct-commit-list');
+ var commits = list.shadowRoot.querySelectorAll('ct-commit');
+ assert(commits[0].data);
+ assert(commits[0].data.summary);
+ done();
+ });
+ });
+
+ it('removing a commit summary', function(done) {
+ card.commitLog.commits['blink']['158545'].summary = undefined;
+ card._commitList.repositories[0].expanded = true;
+
+ setTimeout(function() {
+ var list = card.shadowRoot.querySelector('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, []);
+ assert.deepEqual(event.detail.failures, card.group.failures);
done();
});
« no previous file with comments | « Tools/GardeningServer/ui/test/ct-commit-list-tests.html ('k') | Tools/GardeningServer/ui/test/ct-revision-details-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698