Skip to content

Update to 6.4.5, add a test to exercise #419 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@angular-redux/form": "^6.3.0",
"@angular-redux/router": "^6.3.0",
"@angular-redux/store": "^6.4.1",
"@angular-redux/store": "6.4.5",
"@angular/common": "^4.1.0",
"@angular/compiler": "^4.1.0",
"@angular/core": "^4.1.0",
Expand Down
34 changes: 34 additions & 0 deletions src/app/store/module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { NgRedux, DevToolsExtension } from '@angular-redux/store';
import { NgReduxTestingModule, MockNgRedux } from '@angular-redux/store/testing';
import { TestBed, async, getTestBed } from '@angular/core/testing';
import { StoreModule } from './module';
import { IAppState } from './model';
import { RootEpics } from './epics';

describe('Store Module', () => {
let mockNgRedux: NgRedux<any>;
let devTools: DevToolsExtension;
let mockEpics: RootEpics;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ NgReduxTestingModule ],
}).compileComponents().then(() => {
const testbed = getTestBed();

mockEpics = {
createEpics() { return [] }
} as RootEpics;

devTools = testbed.get(DevToolsExtension);
mockNgRedux = MockNgRedux.getInstance();
});
}));

it('should configure the store when the module is loaded', async(() => {
const configureSpy = spyOn(MockNgRedux.getInstance(), 'configureStore');
const instance = new StoreModule(mockNgRedux, devTools, null, mockEpics);

expect(configureSpy).toHaveBeenCalled();
}));
});
4 changes: 3 additions & 1 deletion src/app/store/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export class StoreModule {
devTools.isEnabled() ? [ devTools.enhancer() ] : []);

// Enable syncing of Angular router state with our Redux store.
ngReduxRouter.initialize();
if (ngReduxRouter) {
ngReduxRouter.initialize();
}

// Enable syncing of Angular form state with our Redux store.
provideReduxForms(store);
Expand Down