Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
fix(vue): vue created() does not check if mixin should run
Browse files Browse the repository at this point in the history
  • Loading branch information
michiel committed Aug 30, 2019
1 parent 09dbcd1 commit 85d59ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/vue/__tests__/Mixin/Collection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ describe('The Collection mixin', () => {
collectionName: 'products',
$store: {
commit: jest.fn(),
getters: {
'hyral_product/collection': jest.fn(() => null),
},
},
initCollection: collectionMixin.methods.initCollection,
loadCollection: collectionMixin.methods.loadCollection,
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/__tests__/Module/createStoreModule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ParameterBag from '@hyral/core/src/Resource/ParameterBag';

describe('The createStoreModule', () => {
test('that a store module is created with the required methods', () => {

const module = createStoreModule({}, {});

expect(module).toHaveProperty('namespaced');
Expand Down Expand Up @@ -191,7 +192,7 @@ describe('The createStoreModule', () => {

const mockModule = { state: { resources: { 1: product.state } }, commit: jest.fn() };
return module.actions.LOAD_RESOURCE(mockModule, '1').then(() => {
expect(mockRepository.findById).toHaveBeenCalledWith('1');
expect(mockRepository.findById).toHaveBeenCalledWith('1', null);
expect(mockModule.commit).toHaveBeenCalledTimes(1);
expect(mockModule.commit).toHaveBeenCalledWith('SET_RESOURCE', product);
});
Expand Down

0 comments on commit 85d59ab

Please sign in to comment.