Index: Tools/GardeningServer/ui/test/ct-unexpected-failures-tests.html |
diff --git a/Tools/GardeningServer/ui/test/ct-unexpected-failures-tests.html b/Tools/GardeningServer/ui/test/ct-unexpected-failures-tests.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5f66b4e2ca0c6e99856ec4d51471ebf7d22e7e9c |
--- /dev/null |
+++ b/Tools/GardeningServer/ui/test/ct-unexpected-failures-tests.html |
@@ -0,0 +1,54 @@ |
+<!-- |
+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-unexpected-failures.html'> |
+ |
+<link rel="import" href="../../model/ct-commit-list.html"> |
+<link rel="import" href="../../model/ct-failures.html"> |
+ |
+<script> |
+(function () { |
+ |
+var assert = chai.assert; |
+ |
+describe('ct-unexpected-failures', function() { |
+ it('test showing partytime', function(done) { |
+ var noFailures = document.createElement('ct-unexpected-failures'); |
+ |
+ var noFailuresForTree = document.createElement('ct-unexpected-failures'); |
+ noFailuresForTree.failures = new CTFailures(new CTCommitList(undefined, [])); |
+ noFailuresForTree.failures.failures = { |
+ othertree: [new CTFailure('step', 'reason', [])] |
+ }; |
+ noFailuresForTree.tree = 'mocktree'; |
+ |
+ var noFailuresByLength = document.createElement('ct-unexpected-failures'); |
+ noFailuresByLength.failures = new CTFailures(new CTCommitList(undefined, [])); |
+ noFailuresByLength.failures.failures = { |
+ mocktree: [] |
+ }; |
+ noFailuresByLength.tree = 'mocktree'; |
+ |
+ var failures = document.createElement('ct-unexpected-failures'); |
+ failures.failures = new CTFailures(new CTCommitList(undefined, [])); |
+ failures.failures.failures = { |
Jeffrey Yasskin
2014/09/02 18:34:53
Hmmm. Can you avoid having the same name 3 deep?
ojan
2014/09/11 03:04:47
Changed the first one to hasFailures. I find I kee
|
+ mocktree: [new CTFailure('step', 'reason', [])] |
+ }; |
+ failures.tree = 'mocktree'; |
+ |
+ setTimeout(function() { |
+ assert.ok(noFailures.shadowRoot.querySelector('ct-party-time').partytime); |
Jeffrey Yasskin
2014/09/02 18:34:53
Style-wise, I'd probably split this into 4 differe
ojan
2014/09/11 03:04:47
Done.
|
+ assert.ok(noFailuresForTree.shadowRoot.querySelector('ct-party-time').partytime); |
+ assert.ok(noFailuresByLength.shadowRoot.querySelector('ct-party-time').partytime); |
+ assert.notOk(failures.shadowRoot.querySelector('ct-party-time').partytime); |
+ |
+ done(); |
+ }); |
+ }); |
+}); |
+ |
+})(); |
+</script> |