| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../ct-commit-list.html"> | 7 <link rel="import" href="../ct-commit-list.html"> |
| 8 | 8 |
| 9 <link rel="import" href="../../model/ct-commit-log-mock.html"> | 9 <link rel="import" href="../../model/ct-commit-log-mock.html"> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 describe('commit list UI', function() { | 24 describe('commit list UI', function() { |
| 25 beforeEach(function(done) { | 25 beforeEach(function(done) { |
| 26 var repos = [ | 26 var repos = [ |
| 27 { commits: [ new CTCommitMock(), new CTCommitMock() ], | 27 { commits: [ new CTCommitMock(), new CTCommitMock() ], |
| 28 expanded: false }, | 28 expanded: false }, |
| 29 { commits: [ new CTCommitMock(), new CTCommitMock() ], | 29 { commits: [ new CTCommitMock(), new CTCommitMock() ], |
| 30 expanded: false } | 30 expanded: false } |
| 31 ]; | 31 ]; |
| 32 | 32 |
| 33 var CommitList = Object.create(Object); | 33 list.commitList = { |
| 34 CommitList.prototype.repositories = function() { | 34 repositories: function() { |
| 35 return repos; | 35 return repos; |
| 36 } |
| 36 }; | 37 }; |
| 37 list.commitList = CommitList; | |
| 38 | 38 |
| 39 setTimeout(done); | 39 setTimeout(done); |
| 40 }); | 40 }); |
| 41 | 41 |
| 42 it('should show no commits by default', function() { | 42 it('should show no commits by default', function() { |
| 43 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | 43 var commits = list.shadowRoot.querySelectorAll('ct-commit'); |
| 44 assert.lengthOf(commits, 0); | 44 assert.lengthOf(commits, 0); |
| 45 }); | 45 }); |
| 46 | 46 |
| 47 describe('expanded test', function() { | 47 describe('expanded test', function() { |
| 48 beforeEach(function(done) { | 48 beforeEach(function(done) { |
| 49 list.commitList.repositories().first().expanded = true; | 49 list.commitList.repositories().first().expanded = true; |
| 50 list.commitList.repositories().last().expanded = true; | 50 list.commitList.repositories().last().expanded = true; |
| 51 setTimeout(done); | 51 setTimeout(done); |
| 52 }); | 52 }); |
| 53 | 53 |
| 54 it('should show commits when expanded', function() { | 54 it('should show commits when expanded', function() { |
| 55 assert.lengthOf(list.shadowRoot.querySelectorAll('ct-commit'), 4); | 55 assert.lengthOf(list.shadowRoot.querySelectorAll('ct-commit'), 4); |
| 56 }); | 56 }); |
| 57 }); | 57 }); |
| 58 }); | 58 }); |
| 59 }); | 59 }); |
| 60 | 60 |
| 61 })() | 61 })() |
| 62 </script> | 62 </script> |
| OLD | NEW |