mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-08 06:46:36 +02:00
Add tests.
This commit is contained in:
@@ -193,6 +193,14 @@ describe('module \'' + ID + '\'', function () {
|
||||
var instance = this.applyFn();
|
||||
assert.isTrue(_.isFunction(instance.changeItems));
|
||||
});
|
||||
|
||||
it('publishes view.changed', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
instance.setItems();
|
||||
assert.isTrue(this.xEvent.pub.calledOnce);
|
||||
assert.strictEqual(this.xEvent.pub.lastCall.args[0], 'view.changed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('.setLocation()', function () {
|
||||
@@ -202,6 +210,14 @@ describe('module \'' + ID + '\'', function () {
|
||||
var instance = this.applyFn();
|
||||
assert.isTrue(_.isFunction(instance.setLocation));
|
||||
});
|
||||
|
||||
it('publishes view.changed', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
instance.setItems();
|
||||
assert.isTrue(this.xEvent.pub.calledOnce);
|
||||
assert.strictEqual(this.xEvent.pub.lastCall.args[0], 'view.changed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('.setHint()', function () {
|
||||
|
Reference in New Issue
Block a user