OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 (function() { | 3 (function() { |
4 | 4 |
5 describe('Template: service-footer-destroy-service.partial', function() { | 5 describe('Template: service-footer-destroy-service.partial', function() { |
6 var requires = ['node', 'juju-gui', 'juju-views', 'juju-tests-utils']; | 6 var requires = ['node', 'juju-gui', 'juju-views', 'juju-tests-utils']; |
7 var Y, conn, env, partial; | 7 var Y, conn, env, partial; |
8 | 8 |
9 before(function(done) { | 9 before(function(done) { |
10 Y = YUI(GlobalConfig).use(requires, function(Y) { | 10 Y = YUI(GlobalConfig).use(requires, function(Y) { |
11 var partials = Y.Handlebars.partials; | 11 var partials = Y.Handlebars.partials; |
12 partial = partials['service-footer-destroy-service']; | 12 partial = partials['service-header-destroy-service']; |
13 done(); | 13 done(); |
14 }); | 14 }); |
15 }); | 15 }); |
16 | 16 |
17 it('does not display a "Destroy" button for the Juju GUI', function() { | 17 it('does not display a "Destroy" button for the Juju GUI', function() { |
18 // Disallow foot-shooting. | 18 // Disallow foot-shooting. |
19 var html = partial({serviceIsJujuGUI: true}); | 19 var html = partial({serviceIsJujuGUI: true}); |
20 assert.notMatch(html, /Destroy/); | 20 assert.notMatch(html, /Destroy/); |
21 }); | 21 }); |
22 | 22 |
(...skipping 17 matching lines...) Expand all Loading... |
40 partial = partials['service-footer-common-controls']; | 40 partial = partials['service-footer-common-controls']; |
41 done(); | 41 done(); |
42 }); | 42 }); |
43 }); | 43 }); |
44 | 44 |
45 it('includes unit count UI for the Juju GUI service', function() { | 45 it('includes unit count UI for the Juju GUI service', function() { |
46 var html = partial({serviceIsJujuGUI: true}); | 46 var html = partial({serviceIsJujuGUI: true}); |
47 assert.match(html, /Unit count/); | 47 assert.match(html, /Unit count/); |
48 }); | 48 }); |
49 | 49 |
| 50 it('includes unit count UI for non-Juju-GUI services', function() { |
| 51 var html = partial({serviceIsJujuGUI: false}); |
| 52 assert.match(html, /Unit count/); |
| 53 }); |
| 54 |
| 55 |
| 56 }); |
| 57 })(); |
| 58 |
| 59 (function() { |
| 60 |
| 61 describe('Template: service-header.partial', function() { |
| 62 var requires = ['node', 'juju-gui', 'juju-views', 'juju-tests-utils']; |
| 63 var Y, conn, env, partial; |
| 64 |
| 65 before(function(done) { |
| 66 Y = YUI(GlobalConfig).use(requires, function(Y) { |
| 67 var partials = Y.Handlebars.partials; |
| 68 partial = partials['service-header']; |
| 69 done(); |
| 70 }); |
| 71 }); |
| 72 |
50 it('does not include (un)expose for the Juju GUI service', function() { | 73 it('does not include (un)expose for the Juju GUI service', function() { |
51 var html = partial({serviceIsJujuGUI: true}); | 74 var html = partial({serviceIsJujuGUI: true}); |
52 assert.notMatch(html, /Expose/); | 75 assert.notMatch(html, /Expose/); |
53 }); | 76 }); |
54 | 77 |
55 it('includes unit count UI for non-Juju-GUI services', function() { | |
56 var html = partial({serviceIsJujuGUI: false}); | |
57 assert.match(html, /Unit count/); | |
58 }); | |
59 | |
60 it('includes (un)expose for non-Juju-GUI services', function() { | 78 it('includes (un)expose for non-Juju-GUI services', function() { |
61 var html = partial({serviceIsJujuGUI: false}); | 79 var html = partial({serviceIsJujuGUI: false}); |
62 assert.match(html, /Expose/); | 80 assert.match(html, /Expose/); |
63 }); | 81 }); |
64 | 82 |
65 | 83 |
66 }); | 84 }); |
67 })(); | 85 })(); |
68 | 86 |
69 (function() { | 87 (function() { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 }); | 137 }); |
120 | 138 |
121 it('shows the destroy or expose UI for non-Juju-GUI services', function() { | 139 it('shows the destroy or expose UI for non-Juju-GUI services', function() { |
122 var html = template({serviceIsJujuGUI: false, units: []}); | 140 var html = template({serviceIsJujuGUI: false, units: []}); |
123 assert.match(html, /Destroy/); | 141 assert.match(html, /Destroy/); |
124 assert.match(html, /Expose/); | 142 assert.match(html, /Expose/); |
125 }); | 143 }); |
126 | 144 |
127 }); | 145 }); |
128 })(); | 146 })(); |
OLD | NEW |