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

Unified Diff: Tools/GardeningServer/model/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/model/test/ct-commit-list-tests.html
diff --git a/Tools/GardeningServer/model/test/ct-commit-list-tests.html b/Tools/GardeningServer/model/test/ct-commit-list-tests.html
new file mode 100644
index 0000000000000000000000000000000000000000..3eb125632c182fb58514f514ebe7e407fc501b46
--- /dev/null
+++ b/Tools/GardeningServer/model/test/ct-commit-list-tests.html
@@ -0,0 +1,77 @@
+<!--
+Copyright 2014 The Chromium Authors. All rights reserved.
+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">
+
+<script>
+(function () {
+
+var assert = chai.assert;
+
+describe('ct-commit-list', function() {
+ describe('commit list Model', function() {
+ it('returns commits', function() {
+ var group = {
+ failures: [
+ {
+ firstFailingRevisions: {
+ 'blink': 158545
+ },
+ lastPassingRevisions: {
+ 'blink': 158544
+ }
+ }
+ ]
+ };
+
+ var cl = new CTCommitList(group, new CTCommitLogMock());
+ assert.lengthOf(cl._commits('blink'), 1);
+ });
+
+ it('handles a backwards revision range', function() {
+ var group = {
+ failures: [
+ {
+ firstFailingRevisions: {
+ 'blink': 158544
+ },
+ lastPassingRevisions: {
+ 'blink': 158545
+ }
+ }
+ ]
+ };
+
+ var cl = new CTCommitList(group, new CTCommitLogMock());
+ assert.lengthOf(cl._commits('blink'), 0);
+ });
+
+ it ('returns repositories', function() {
+ var group = {
+ failures: [
+ {
+ firstFailingRevisions: {
+ 'blink': 158545
+ },
+ lastPassingRevisions: {
+ 'blink': 158544
+ }
+ }
+ ]
+ };
+
+ var cl = new CTCommitList(group, new CTCommitLogMock());
+ var repos = cl.repositories();
+ assert.lengthOf(repos, 1);
+ assert.equal(repos[0].name, 'blink');
+ assert.lengthOf(repos[0].commits, 1);
+ assert.equal(repos[0].range, '158545 : 158545')
+ });
+ });
+});
+
+})();
+</script>

Powered by Google App Engine
This is Rietveld 408576698