| Index: Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| diff --git a/Tools/GardeningServer/ui/ct-commit-list-tests.html b/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| similarity index 15%
|
| rename from Tools/GardeningServer/ui/ct-commit-list-tests.html
|
| rename to Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| index 19fef0d2296891b32500d70035a1d382ff6da228..6a45f9edaab6b09030ae15ee972dcf70a7fb6a18 100644
|
| --- a/Tools/GardeningServer/ui/ct-commit-list-tests.html
|
| +++ b/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| @@ -4,59 +4,58 @@ 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-commit-list.html">
|
| +<link rel="import" href="../ct-commit-list.html">
|
|
|
| -<link rel="import" href="../model/ct-commit-log-mock.html">
|
| +<link rel="import" href="../../model/ct-commit-log-mock.html">
|
|
|
| <script>
|
| (function () {
|
|
|
| -module("ct-commit-list");
|
| +var assert = chai.assert;
|
|
|
| -asyncTest("basic", 1, function() {
|
| - var list = document.createElement('ct-commit-list');
|
| +describe('ct-commit-list', function() {
|
| + var list;
|
| + var numCommits;
|
|
|
| - list.commits = new CTCommitLogMock();
|
| + 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.
|
| - list.commits.firstRevision = {};
|
| + // 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;
|
| + var blinkCommits = list.commits.commits.blink;
|
| + var revision;
|
| + for (revision in blinkCommits)
|
| + break;
|
|
|
| - var numCommits = 2;
|
| + list.first = {blink: revision};
|
| + list.last = {blink: Number(revision) + numCommits};
|
|
|
| - list.first = {blink: revision};
|
| - list.last = {blink: Number(revision) + numCommits};
|
| -
|
| - requestAnimationFrame(function() {
|
| - var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| - equal(commits.length, numCommits);
|
| -
|
| - start();
|
| + setTimeout(done);
|
| });
|
| -});
|
|
|
| -asyncTest("backwards", 1, function() {
|
| - var list = document.createElement('ct-commit-list');
|
| + describe('commit list UI', function() {
|
| + before(function() {
|
| + numCommits = 2;
|
| + });
|
|
|
| - list.commits = new CTCommitLogMock();
|
| -
|
| - var blinkCommits = list.commits.commits.blink;
|
| - var revision;
|
| - for (revision in blinkCommits)
|
| - break;
|
| -
|
| - list.first = {blink: revision};
|
| - list.last = {blink: Number(revision) - 1};
|
| + it('should show all commits in revision range', function() {
|
| + var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| + assert.lengthOf(commits, numCommits);
|
| + });
|
| + });
|
|
|
| - requestAnimationFrame(function() {
|
| - var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| - equal(commits.length, 0);
|
| + describe('empty commit list UI', function() {
|
| + before(function() {
|
| + numCommits = 0;
|
| + });
|
|
|
| - start();
|
| + it('should show no commits for backwards revision range', function() {
|
| + var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| + assert.lengthOf(commits, numCommits);
|
| + });
|
| });
|
| });
|
|
|
|
|