1<!-- 2Copyright 2014 The Chromium Authors. All rights reserved. 3Use of this source code is governed by a BSD-style license that can be 4found in the LICENSE file. 5--> 6 7<link rel="import" href="../ct-tree-status.html"> 8 9<script> 10(function () { 11 12var assert = chai.assert; 13 14describe('ct-tree-status', function() { 15 it('should show statuses', function(done) { 16 var openTree = document.createElement("ct-tree-status"); 17 var openTreeStatus = new TreeStatus('open-tree-project'); 18 openTreeStatus.status = 'open'; 19 openTree.status = openTreeStatus; 20 21 var throttledTree = document.createElement("ct-tree-status"); 22 var throttledTreeStatus = new TreeStatus('throttled-tree-project'); 23 throttledTreeStatus.status = 'throttled'; 24 throttledTreeStatus.message = 'Tree is throttled just for fun'; 25 throttledTree.status = throttledTreeStatus; 26 27 var closedTree = document.createElement("ct-tree-status"); 28 var closedTreeStatus = new TreeStatus('closed-tree-project'); 29 closedTreeStatus.status = 'closed'; 30 closedTreeStatus.message = 'Tree is closed'; 31 closedTree.status = closedTreeStatus; 32 33 setTimeout(function() { 34 assert.notInclude(!openTree.shadowRoot.textContent, "open-tree-project"); 35 assert.include(throttledTree.shadowRoot.textContent, "throttled-tree-project"); 36 assert.include(closedTree.shadowRoot.textContent, "closed-tree-project"); 37 assert.equal(closedTree.shadowRoot.querySelector('a').href, closedTreeStatus.url); 38 39 done(); 40 }); 41 }); 42}); 43 44})(); 45</script> 46