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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { TestBed } from "@angular/core/testing"
import { provideMockActions } from "@ngrx/effects/testing"
import { Action } from "@ngrx/store"
import { MockStore, provideMockStore } from "@ngrx/store/testing"
import { hot } from "jasmine-marbles"
import { Observable } from "rxjs"
import { annotation, atlasAppearance } from "src/state"
import { NgAnnotationEffects } from "./effects"
describe("effects.ts", () => {
describe("NgAnnotationEffects", () => {
let actions$: Observable<Action>
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
provideMockStore(),
provideMockActions(() => actions$),
NgAnnotationEffects,
]
})
})
describe("onAnnotationHideQuadrant", () => {
describe("> when space filtered annotation does not exist", () => {
it("> should setOctantRemoval true", () => {
const mockStore = TestBed.inject(MockStore)
mockStore.overrideSelector(annotation.selectors.spaceFilteredAnnotations, [])
const effect = TestBed.inject(NgAnnotationEffects)
expect(effect.onAnnotationHideQuadrant).toBeObservable(
hot('a', {
a: atlasAppearance.actions.setOctantRemoval({
flag: true
})
})
)
})
})
describe("> when space filtered annotation exist", () => {
it("> should setOctantRemoval false", () => {
const mockStore = TestBed.inject(MockStore)
mockStore.overrideSelector(annotation.selectors.spaceFilteredAnnotations, [{} as any])
const effect = TestBed.inject(NgAnnotationEffects)
expect(effect.onAnnotationHideQuadrant).toBeObservable(
hot('a', {
a: atlasAppearance.actions.setOctantRemoval({
flag: false
})
})
)
})
})
describe("> on switch of space filtered annotations length", () => {
it("> should emit accordingly")
})
describe("> on repeated emit of space filtered annotations length", () => {
it("> should only emit once")
})
})
})
})