2016-04-22 08:34:11 +00:00
|
|
|
|
|
|
|
define(['es5-ff-spa-loader'], function(FFSpaLoader) {
|
2016-04-23 01:58:27 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-04-22 08:34:11 +00:00
|
|
|
describe('Start loader', function() {
|
2016-11-17 18:05:26 +00:00
|
|
|
beforeEach(function () {
|
|
|
|
function emptyElement(element) {
|
|
|
|
var myNode = element;
|
|
|
|
while (myNode.firstChild) {
|
|
|
|
myNode.removeChild(myNode.firstChild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
emptyElement(document.head);
|
|
|
|
emptyElement(document.body);
|
|
|
|
});
|
2016-04-22 08:34:11 +00:00
|
|
|
it('FFSpaLoader start with error', function(done) {
|
|
|
|
FFSpaLoader.options.server.url = 'http://localhost:9999';
|
2016-11-17 18:05:26 +00:00
|
|
|
FFSpaLoader.start(function(err) {
|
|
|
|
if (err !== null) {
|
|
|
|
done();
|
|
|
|
} else {
|
|
|
|
fail();
|
|
|
|
}
|
|
|
|
});
|
2016-04-22 08:34:11 +00:00
|
|
|
});
|
|
|
|
it('FFSpaLoader starts', function(done) {
|
|
|
|
FFSpaLoader.options.server.url = 'http://localhost:9090/test';
|
|
|
|
FFSpaLoader.options.server.assets = '/static/spa-client-resources';
|
2016-11-17 18:05:26 +00:00
|
|
|
FFSpaLoader.start(function(err) {
|
|
|
|
if (err !== null) {
|
|
|
|
fail();
|
|
|
|
} else {
|
|
|
|
done();
|
|
|
|
}
|
2016-04-22 08:34:11 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it('FFSpaLoader starts again', function(done) {
|
|
|
|
FFSpaLoader.options.server.url = 'http://localhost:9090/test';
|
|
|
|
FFSpaLoader.options.server.assets = '/static/spa-client-resources';
|
2016-11-17 18:05:26 +00:00
|
|
|
FFSpaLoader.start(function(err) {
|
|
|
|
if (err !== null) {
|
|
|
|
fail();
|
|
|
|
} else {
|
|
|
|
done();
|
|
|
|
}
|
2016-04-22 08:34:11 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|