LEFT | RIGHT |
(no file at all) | |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 | 3 |
4 describe('charm token', function() { | 4 describe('charm token', function() { |
5 var charm_container, CharmToken, Y; | 5 var charm_container, CharmToken, Y; |
6 | 6 |
7 before(function(done) { | 7 before(function(done) { |
8 Y = YUI(GlobalConfig).use( | 8 Y = YUI(GlobalConfig).use( |
9 ['browser-charm-token', 'node-event-simulate'], function(Y) { | 9 ['browser-charm-token', 'node-event-simulate', |
| 10 'juju-tests-utils'], function(Y) { |
10 CharmToken = Y.juju.widgets.browser.CharmToken; | 11 CharmToken = Y.juju.widgets.browser.CharmToken; |
11 done(); | 12 done(); |
12 }); | 13 }); |
13 }); | 14 }); |
14 | 15 |
15 beforeEach(function() { | 16 beforeEach(function() { |
16 charm_container = Y.Node.create('<div id="charm-container"></div>'); | 17 charm_container = Y.namespace('juju-tests.utils') |
17 Y.one(document.body).prepend(charm_container); | 18 .makeContainer('charm-container'); |
18 }); | 19 }); |
19 | 20 |
20 afterEach(function() { | 21 afterEach(function() { |
21 Y.one('#charm-container').remove(true); | 22 charm_container.remove(true); |
22 }); | 23 }); |
23 | 24 |
24 it('exists', function() { | 25 it('exists', function() { |
25 var charm = new CharmToken(); | 26 var charm = new CharmToken(); |
26 assert.isObject(charm); | 27 assert.isObject(charm); |
27 }); | 28 }); |
28 | 29 |
29 it('renders with correct metadata', function() { | 30 it('renders with correct metadata', function() { |
30 var cfg = { | 31 var cfg = { |
31 id: 'test', | 32 id: 'test', |
(...skipping 27 matching lines...) Expand all Loading... |
59 }); | 60 }); |
60 charm.get('size').should.eql('large'); | 61 charm.get('size').should.eql('large'); |
61 | 62 |
62 // and the css class should be on the token once rendered. | 63 // and the css class should be on the token once rendered. |
63 charm.render(charm_container); | 64 charm.render(charm_container); |
64 charm_container.one('.charm-token').hasClass('large').should.equal(true); | 65 charm_container.one('.charm-token').hasClass('large').should.equal(true); |
65 }); | 66 }); |
66 | 67 |
67 | 68 |
68 }); | 69 }); |
LEFT | RIGHT |