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

Unified Diff: Tools/GardeningServer/ui/test/ct-commit-list-tests.html

Issue 464963003: Move commit list out its own model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/ui/test/ct-commit-list-tests.html
diff --git a/Tools/GardeningServer/ui/test/ct-commit-list-tests.html b/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
index 6a45f9edaab6b09030ae15ee972dcf70a7fb6a18..04dfa6e52c178332d0f647fab53446f9eb7f415c 100644
--- a/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
+++ b/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
@@ -15,46 +15,30 @@ var assert = chai.assert;
describe('ct-commit-list', function() {
var list;
- var numCommits;
beforeEach(function(done) {
list = document.createElement('ct-commit-list');
- list.commits = new CTCommitLogMock();
-
- // FIXME: This test shouldn't rely on firstRevision being empty to pass.
- if (numCommits > 0)
- list.commits.firstRevision = {};
-
- var blinkCommits = list.commits.commits.blink;
- var revision;
- for (revision in blinkCommits)
- break;
-
- list.first = {blink: revision};
- list.last = {blink: Number(revision) + numCommits};
setTimeout(done);
});
describe('commit list UI', function() {
- before(function() {
- numCommits = 2;
+ beforeEach(function(done) {
+ var CommitList = Object.create(Object);
+ CommitList.prototype.repositories = function() {
+ return [
+ { commits: [ new CTCommitMock(), new CTCommitMock() ] },
+ { commits: [ new CTCommitMock(), new CTCommitMock() ] }
+ ]
+ };
+ list.commitList = CommitList;
+
+ setTimeout(done);
});
it('should show all commits in revision range', function() {
var commits = list.shadowRoot.querySelectorAll('ct-commit');
- assert.lengthOf(commits, numCommits);
- });
- });
-
- describe('empty commit list UI', function() {
- before(function() {
- numCommits = 0;
- });
-
- it('should show no commits for backwards revision range', function() {
- var commits = list.shadowRoot.querySelectorAll('ct-commit');
- assert.lengthOf(commits, numCommits);
+ assert.lengthOf(commits, 4);
});
});
});

Powered by Google App Engine
This is Rietveld 408576698