Add hogfather basic structure.
This commit is contained in:
@@ -21,8 +21,13 @@
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @param {Cosmopolite} cosmo
|
* @param {Cosmopolite} cosmo
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
|
* @param {function()} onReady
|
||||||
*/
|
*/
|
||||||
var Hogfather = function(cosmo, name) {
|
var Hogfather = function(cosmo, name, onReady) {
|
||||||
|
cosmo.getProfile().then(function(profile_id) {
|
||||||
|
this.prefix_ = '/hogfather/' + profile_id + '/' + name + '/';
|
||||||
|
onReady();
|
||||||
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -947,14 +947,19 @@ QUnit.asyncTest('sendMessage admin ACL', function(assert) {
|
|||||||
|
|
||||||
QUnit.module('Hogfather');
|
QUnit.module('Hogfather');
|
||||||
|
|
||||||
QUnit.test('Construct/shutdown', function(assert) {
|
QUnit.asyncTest('Construct/shutdown', function(assert) {
|
||||||
assert.expect(4);
|
assert.expect(4);
|
||||||
var cosmo = new Cosmopolite(null, randstring());
|
var cosmo = new Cosmopolite(null, randstring());
|
||||||
assert.ok(true, 'new Cosmopolite() succeeds');
|
assert.ok(true, 'new Cosmopolite() succeeds');
|
||||||
var hogfather = new Hogfather(cosmo, randstring());
|
|
||||||
assert.ok(true, 'new Hogfather()) succeeds');
|
var hogfather = new Hogfather(cosmo, randstring(), function() {
|
||||||
hogfather.shutdown();
|
hogfather.shutdown();
|
||||||
assert.ok(true, 'Hogfather.shutdown() succeeds');
|
assert.ok(true, 'Hogfather.shutdown() succeeds');
|
||||||
|
|
||||||
cosmo.shutdown();
|
cosmo.shutdown();
|
||||||
assert.ok(true, 'Cosmopolite.shutdown() succeeds');
|
assert.ok(true, 'Cosmopolite.shutdown() succeeds');
|
||||||
|
|
||||||
|
QUnit.start();
|
||||||
|
});
|
||||||
|
assert.ok(true, 'new Hogfather()) succeeds');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user