106974: Angular SSR menu issues

This commit is contained in:
Yana De Pauw
2023-09-18 16:43:32 +02:00
parent 404ccd9b0e
commit 3e8d180f1b
8 changed files with 126 additions and 13 deletions

View File

@@ -0,0 +1,41 @@
import { Observable } from 'rxjs';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
import { cold, hot } from 'jasmine-marbles';
import { MenuEffects } from './menu.effects';
import { ReinitMenuAction } from './menu.actions';
import { StoreAction, StoreActionTypes } from '../../store.actions';
describe('MenuEffects', () => {
let menuEffects: MenuEffects;
let actions: Observable<any>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [
MenuEffects,
provideMockActions(() => actions),
],
});
}));
beforeEach(() => {
menuEffects = TestBed.inject(MenuEffects);
});
describe('reinitDSOMenus', () => {
describe('When a REHYDRATE action is triggered', () => {
let action;
beforeEach(() => {
action = new StoreAction(StoreActionTypes.REHYDRATE, null);
});
it('should return a ReinitMenuAction', () => {
actions = hot('--a-', {a: action});
const expected = cold('--b-', {b: new ReinitMenuAction});
expect(menuEffects.reinitDSOMenus).toBeObservable(expected);
});
});
});
});