| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 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 | |
| 4 found in the LICENSE file. | |
| 5 --> | |
| 6 | |
| 7 <link rel="import" href="../ct-step-failure-card.html"> | |
| 8 | |
| 9 <link rel="import" href="../../model/ct-commit-list-mock.html"> | |
| 10 <link rel="import" href="../../model/ct-commit-log-mock.html"> | |
| 11 <link rel="import" href="../../model/ct-failure-group.html"> | |
| 12 | |
| 13 <script> | |
| 14 (function () { | |
| 15 | |
| 16 var assert = chai.assert; | |
| 17 | |
| 18 describe('ct-step-failure-card', function() { | |
| 19 var group; | |
| 20 var card; | |
| 21 var failures; | |
| 22 | |
| 23 beforeEach(function(done) { | |
| 24 card = document.createElement('ct-step-failure-card'); | |
| 25 var cl = new CTCommitListMock(); | |
| 26 group = new CTFailureGroup('blink', new CTStepFailureGroupData([ | |
| 27 new CTStepFailure('autobot', 'unknown', {someBuilder: {key: 'a'}}, {'bli
nk':158547}, | |
| 28 {'blink':158544})], cl)); | |
| 29 card.group = group.data; | |
| 30 card.commitLog = new CTCommitLogMock(); | |
| 31 setTimeout(done); | |
| 32 }); | |
| 33 | |
| 34 describe('failure card UI', function() { | |
| 35 | |
| 36 it('should have commit summaries', function(done) { | |
| 37 // Expand the first repository so that the <ct-commit>'s are generated. | |
| 38 card.group.commitList.repositories[0].expanded = true; | |
| 39 | |
| 40 setTimeout(function() { | |
| 41 var list = card.shadowRoot.querySelector('ct-commit-list'); | |
| 42 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | |
| 43 assert(commits[1].data); | |
| 44 assert(commits[1].data.summary); | |
| 45 done(); | |
| 46 }); | |
| 47 }); | |
| 48 | |
| 49 it('removing a commit summary', function(done) { | |
| 50 card.commitLog.commits['blink']['158545'].summary = undefined; | |
| 51 card.group.commitList.repositories[0].expanded = true; | |
| 52 | |
| 53 setTimeout(function() { | |
| 54 var list = card.shadowRoot.querySelector('ct-commit-list'); | |
| 55 var commits = list.shadowRoot.querySelectorAll('ct-commit'); | |
| 56 assert.notOk(commits[0].data.summary); | |
| 57 done(); | |
| 58 }); | |
| 59 }); | |
| 60 | |
| 61 }); | |
| 62 | |
| 63 }); | |
| 64 | |
| 65 })() | |
| 66 </script> | |
| OLD | NEW |