| Index: Tools/GardeningServer/ui/test/ct-revision-details-tests.html
|
| diff --git a/Tools/GardeningServer/ui/test/ct-commit-list-tests.html b/Tools/GardeningServer/ui/test/ct-revision-details-tests.html
|
| similarity index 21%
|
| copy from Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| copy to Tools/GardeningServer/ui/test/ct-revision-details-tests.html
|
| index 6a45f9edaab6b09030ae15ee972dcf70a7fb6a18..64c85aa2d6c87e0f6a46f8e7d7a36505cca5f810 100644
|
| --- a/Tools/GardeningServer/ui/test/ct-commit-list-tests.html
|
| +++ b/Tools/GardeningServer/ui/test/ct-revision-details-tests.html
|
| @@ -4,8 +4,9 @@ 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-revision-details.html">
|
|
|
| +<link rel="import" href="../../model/ct-builder-revisions-mock.html">
|
| <link rel="import" href="../../model/ct-commit-log-mock.html">
|
|
|
| <script>
|
| @@ -13,51 +14,42 @@ found in the LICENSE file.
|
|
|
| var assert = chai.assert;
|
|
|
| -describe('ct-commit-list', function() {
|
| - var list;
|
| - var numCommits;
|
| +describe('ct-revision-details', function() {
|
| + var revisionDetails;
|
|
|
| - 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;
|
| + describe('empty', function() {
|
| + before(function(done) {
|
| + revisionDetails = document.createElement('ct-revision-details');
|
| + setTimeout(done);
|
| });
|
|
|
| - it('should show all commits in revision range', function() {
|
| - var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| - assert.lengthOf(commits, numCommits);
|
| + it('should not show revision', function() {
|
| + assert.isNull(revisionDetails.shadowRoot.querySelector('#fullyProcessedRevision'));
|
| + assert.isNull(revisionDetails.shadowRoot.querySelector('#trunkRevision'));
|
| });
|
| });
|
|
|
| - describe('empty commit list UI', function() {
|
| - before(function() {
|
| - numCommits = 0;
|
| + describe('blink revision', function() {
|
| + before(function(done) {
|
| + revisionDetails = document.createElement('ct-revision-details');
|
| +
|
| + var builderRevisions = CTBuilderRevisionsMock();
|
| + var commitLog = CTCommitLogMock();
|
| + commitLog._findFirstAndLastRevisions('blink');
|
| +
|
| + revisionDetails.builderLatestRevisions = builderRevisions;
|
| + revisionDetails.tree = 'blink';
|
| + revisionDetails.revisionLog = commitLog;
|
| +
|
| + setTimeout(done);
|
| });
|
|
|
| - it('should show no commits for backwards revision range', function() {
|
| - var commits = list.shadowRoot.querySelectorAll('ct-commit');
|
| - assert.lengthOf(commits, numCommits);
|
| + it('should show the revision', function() {
|
| + assert.equal(revisionDetails.shadowRoot.querySelector('#fullyProcessedRevision').innerText, '158543');
|
| + assert.equal(revisionDetails.shadowRoot.querySelector('#trunkRevision').innerText, '158545');
|
| });
|
| });
|
| });
|
|
|
| -})()
|
| +})();
|
| </script>
|
|
|