Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(71)

Unified Diff: test/test_app.js

Issue 7003054: Make tests more reliable.
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/test_app.js
=== modified file 'test/test_app.js'
--- test/test_app.js 2012-12-03 20:24:44 +0000
+++ test/test_app.js 2012-12-24 03:41:03 +0000
@@ -31,9 +31,18 @@
return app;
}
-YUI(GlobalConfig).use(['juju-gui', 'juju-tests-utils'], function(Y) {
+(function() {
+
describe('Application basics', function() {
- var app, container;
+ var Y, app, container;
+
+ before(function(done) {
+ Y = YUI(GlobalConfig).use(
+ ['juju-gui', 'juju-tests-utils'],
+ function(Y) {
+ done();
+ });
+ });
beforeEach(function() {
container = Y.one('#main')
@@ -116,14 +125,22 @@
});
});
-});
-
-YUI(GlobalConfig).use(['juju-gui', 'juju-tests-utils'], function(Y) {
+})();
+
+
+
+(function() {
+
describe('Application Connection State', function() {
- var container;
+ var container, Y;
- before(function() {
- container = Y.Node.create('<div id="test" class="container"></div>');
+ before(function(done) {
+ Y = YUI(GlobalConfig).use(['juju-gui', 'juju-tests-utils'],
+ function(Y) {
+ container = Y.Node.create(
+ '<div id="test" class="container"></div>');
+ done();
+ });
});
it('should be able to handle env connection status changes', function() {
@@ -134,7 +151,6 @@
reset_called = false,
noop = function() {return this;};
-
// mock the db
app.db = {
// mock out notifications
@@ -162,15 +178,23 @@
});
});
-});
-
-YUI(GlobalConfig).use(['juju-models', 'juju-gui', 'datasource-local',
- 'juju-tests-utils', 'json-stringify'], function(Y) {
+})();
+
+
+(function() {
+
describe('Application prefetching', function() {
- var models, conn, env, app, container, charm_store, data, juju;
+ var Y, models, conn, env, app, container, charm_store, data, juju;
- before(function() {
- models = Y.namespace('juju.models');
+ before(function(done) {
+ console.log('Loading App prefetch test code');
+ Y = YUI(GlobalConfig).use(
+ ['juju-gui', 'datasource-local',
+ 'juju-views', 'juju-templates',
+ 'juju-tests-utils', 'json-stringify'], function(Y) {
+ models = Y.namespace('juju.models');
+ done();
+ });
});
beforeEach(function() {
@@ -237,4 +261,4 @@
get_endpoints_count.should.equal(2);
});
});
-});
+})();
« test/index.html ('K') | « test/index.html ('k') | test/test_app_hotkeys.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b