OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 (function() { | 3 (function() { |
4 | 4 |
5 describe('browser_charm_view', function() { | 5 describe('browser_charm_view', function() { |
6 var CharmView, models, node, view, views, Y; | 6 var CharmView, models, node, view, views, Y; |
7 | 7 |
8 before(function(done) { | 8 before(function(done) { |
9 Y = YUI(GlobalConfig).use( | 9 Y = YUI(GlobalConfig).use( |
10 'datatype-date', | 10 'datatype-date', |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 view = new CharmView({ | 546 view = new CharmView({ |
547 charm: new models.BrowserCharm(data), | 547 charm: new models.BrowserCharm(data), |
548 container: Y.Node.create('<div class="charmview"/>') | 548 container: Y.Node.create('<div class="charmview"/>') |
549 }); | 549 }); |
550 | 550 |
551 view.render(); | 551 view.render(); |
552 // Basics that we have the right number of nodes. | 552 // Basics that we have the right number of nodes. |
553 node.all('.provider-warning').size().should.eql(1); | 553 node.all('.provider-warning').size().should.eql(1); |
554 node.all('.provider-warning img').size().should.eql(4); | 554 node.all('.provider-warning img').size().should.eql(4); |
555 }); | 555 }); |
| 556 |
| 557 it('shows and hides an indicator', function(done) { |
| 558 var hit = 0; |
| 559 |
| 560 var fakeStore = new Y.juju.Charmworld0({}); |
| 561 var data = Y.JSON.parse( |
| 562 Y.io('data/browsercharm.json', {sync: true}).responseText); |
| 563 // We don't want any files so we don't have to mock/load them. |
| 564 data.files = []; |
| 565 view = new CharmView({ |
| 566 charm: new models.BrowserCharm(data), |
| 567 container: Y.Node.create('<div class="charmview"/>') |
| 568 }); |
| 569 |
| 570 view.showIndicator = function() { |
| 571 hit += 1; |
| 572 }; |
| 573 view.hideIndicator = function() { |
| 574 hit += 1; |
| 575 hit.should.equal(2); |
| 576 done(); |
| 577 }; |
| 578 view.render(); |
| 579 }); |
556 }); | 580 }); |
557 | 581 |
558 })(); | 582 })(); |
OLD | NEW |