Newer
Older
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
42
43
44
import { TestBed } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
import { EffectsMetadata, getEffectsMetadata } from '@ngrx/effects';
import { provideMockStore } from '@ngrx/store/testing';
import { Observable } from 'rxjs';
import { ToastrService } from 'ngx-toastr';
import { SvomJsonKwEffects } from './svom-json-kw.effects';
import { SvomJsonKwService } from '../services/svom-json-kw.service';
import * as fromSvomJsonKw from '../reducers/svom-json-kw.reducer';
describe('[Instance][Store] SvomJsonKwEffects', () => {
let actions = new Observable();
let effects: SvomJsonKwEffects;
let metadata: EffectsMetadata<SvomJsonKwEffects>;
let svomJsonKwService: SvomJsonKwService;
let toastr: ToastrService;
const initialState = {
instance: {
svomJsonKw: { ...fromSvomJsonKw.initialState }
}
};
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
SvomJsonKwEffects,
{ provide: SvomJsonKwService, useValue: { loadKwSearchable: jest.fn() }},
{ provide: ToastrService, useValue: { success: jest.fn(), error: jest.fn() }},
provideMockActions(() => actions),
provideMockStore({ initialState })
]
}).compileComponents();
effects = TestBed.inject(SvomJsonKwEffects);
metadata = getEffectsMetadata(effects);
svomJsonKwService = TestBed.inject(SvomJsonKwService);
toastr = TestBed.inject(ToastrService);
});
it('should be created', () => {
expect(effects).toBeTruthy();
});
});