|
@@ -31,36 +31,43 @@ describe('GroupStore', function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- describe('onUpdate()', function () {
|
|
|
- it('should treat undefined itemIds argument as \'all\'', function () {
|
|
|
+ describe('update methods', function () {
|
|
|
+ beforeEach(function () {
|
|
|
GroupStore.items = [
|
|
|
{id: 1},
|
|
|
{id: 2},
|
|
|
{id: 3},
|
|
|
];
|
|
|
+ });
|
|
|
|
|
|
- this.sandbox.stub(GroupStore, 'trigger');
|
|
|
- GroupStore.onUpdate(1337, undefined, 'somedata');
|
|
|
-
|
|
|
+ describe('onUpdate()', function () {
|
|
|
+ it('should treat undefined itemIds argument as \'all\'', function () {
|
|
|
+ this.sandbox.stub(GroupStore, 'trigger');
|
|
|
+ GroupStore.onUpdate(1337, undefined, 'somedata');
|
|
|
|
|
|
- expect(GroupStore.trigger.calledOnce).to.be.ok;
|
|
|
- expect(GroupStore.trigger.firstCall.args[0]).to.eql(new Set([1,2,3]));
|
|
|
+ expect(GroupStore.trigger.calledOnce).to.be.ok;
|
|
|
+ expect(GroupStore.trigger.firstCall.args[0]).to.eql(new Set([1,2,3]));
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
|
|
|
- describe('onUpdateSuccess()', function () {
|
|
|
- it('should treat undefined itemIds argument as \'all\'', function () {
|
|
|
- GroupStore.items = [
|
|
|
- {id: 1},
|
|
|
- {id: 2},
|
|
|
- {id: 3},
|
|
|
- ];
|
|
|
+ describe('onUpdateSuccess()', function () {
|
|
|
+ it('should treat undefined itemIds argument as \'all\'', function () {
|
|
|
+ this.sandbox.stub(GroupStore, 'trigger');
|
|
|
+ GroupStore.onUpdateSuccess(1337, undefined, 'somedata');
|
|
|
+
|
|
|
+ expect(GroupStore.trigger.calledOnce).to.be.ok;
|
|
|
+ expect(GroupStore.trigger.firstCall.args[0]).to.eql(new Set([1,2,3]));
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- this.sandbox.stub(GroupStore, 'trigger');
|
|
|
- GroupStore.onUpdateSuccess(1337, undefined, 'somedata');
|
|
|
+ describe('onUpdateError()', function () {
|
|
|
+ it('should treat undefined itemIds argument as \'all\'', function () {
|
|
|
+ this.sandbox.stub(GroupStore, 'trigger');
|
|
|
+ GroupStore.onUpdateError(1337, undefined, 'something failed', false);
|
|
|
|
|
|
- expect(GroupStore.trigger.calledOnce).to.be.ok;
|
|
|
- expect(GroupStore.trigger.firstCall.args[0]).to.eql(new Set([1,2,3]));
|
|
|
+ expect(GroupStore.trigger.calledOnce).to.be.ok;
|
|
|
+ expect(GroupStore.trigger.firstCall.args[0]).to.eql(new Set([1,2,3]));
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
});
|