-
Notifications
You must be signed in to change notification settings - Fork 543
Expand file tree
/
Copy paththeme.effects.spec.ts
More file actions
44 lines (39 loc) · 1012 Bytes
/
theme.effects.spec.ts
File metadata and controls
44 lines (39 loc) · 1012 Bytes
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 { ThemeEffects } from './theme.effects';
import { TestBed } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
import { hot } from 'jasmine-marbles';
import { ROOT_EFFECTS_INIT } from '@ngrx/effects';
import { provideMockStore } from '@ngrx/store/testing';
describe('ThemeEffects', () => {
let themeEffects: ThemeEffects;
let initialState;
function init() {
initialState = {
theme: {
currentTheme: 'custom',
},
};
}
function setupEffectsWithActions(mockActions) {
init();
TestBed.configureTestingModule({
providers: [
ThemeEffects,
provideMockStore({ initialState }),
provideMockActions(() => mockActions)
]
});
themeEffects = TestBed.inject(ThemeEffects);
}
describe('initTheme$', () => {
beforeEach(() => {
setupEffectsWithActions(
hot('--a-', {
a: {
type: ROOT_EFFECTS_INIT
}
})
);
});
});
});