forked from angular-redux/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.spec.ts
41 lines (35 loc) · 1.15 KB
/
module.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { DevToolsExtension, NgRedux } from '@angular-redux/store';
import {
MockNgRedux,
NgReduxTestingModule,
} from '@angular-redux/store/testing';
import { async, getTestBed, TestBed } from '@angular/core/testing';
import { RootEpics } from './epics';
import { AppState } from './model';
import { StoreModule } from './module';
describe('Store Module', () => {
let mockNgRedux: NgRedux<AppState>;
let devTools: DevToolsExtension;
let mockEpics: Partial<RootEpics>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [NgReduxTestingModule],
})
.compileComponents()
.then(() => {
const testbed = getTestBed();
mockEpics = {
createEpics() {
return [] as any;
},
};
devTools = testbed.get(DevToolsExtension);
mockNgRedux = MockNgRedux.getInstance();
});
}));
it('should configure the store when the module is loaded', async(() => {
const configureSpy = spyOn(MockNgRedux.getInstance(), 'configureStore');
new StoreModule(mockNgRedux, devTools, null as any, mockEpics as any);
expect(configureSpy).toHaveBeenCalled();
}));
});