Skip to content

Commit

Permalink
chore(): fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lxo committed May 4, 2022
1 parent 092edda commit d35b7be
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@ coverage
*.tgz
examples/**/dist
.idea
.npmrc
2 changes: 1 addition & 1 deletion src/components/ngRedux.js
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export default function ngReduxProvider() {

const mergedStore = assign({}, store, { connect: Connector(store) });

if (_providedStore) wrapStore(_providedStore, mergedStore, injector.get('$rootScope'));
if (_providedStore) wrapStore(_providedStore, mergedStore, $injector.get('$rootScope'));

return mergedStore;
};
3 changes: 2 additions & 1 deletion test/components/storeWrapper.spec.js
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ const mockStore = function(callback) {
};
};

const mockRootScope = { $on: () => {} };

describe('storeWrapper', () => {
it('should pass new state from provided store to ngReduxStore', () => {
@@ -24,7 +25,7 @@ describe('storeWrapper', () => {
}
});

const wrappedStore = wrapStore(providedStore, ngReduxStore);
const wrappedStore = wrapStore(providedStore, ngReduxStore, mockRootScope);

providedStore.dispatch({
type: 'TEST',
3 changes: 2 additions & 1 deletion test/integration/ngReduxProvidedStore.spec.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@ describe('ngRedux provide store functionality', () => {
let ngRedux = {};
let $injector = {};
let $rootScope = {
$evalAsync: () => {}
$evalAsync: () => {},
$on: () => {}
}

beforeEach(() => {

0 comments on commit d35b7be

Please sign in to comment.