finished dynamic menus

This commit is contained in:
lotte
2018-12-06 15:50:12 +01:00
parent c17b395ba0
commit 07c9927b6a
39 changed files with 720 additions and 379 deletions

View File

@@ -1,11 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { NavbarEffects } from './navbar.effects';
import { NavbarCollapseAction } from './navbar.actions';
import { HostWindowResizeAction } from '../shared/host-window.actions';
import { Observable } from 'rxjs';
import { provideMockActions } from '@ngrx/effects/testing';
import { cold, hot } from 'jasmine-marbles';
import * as fromRouter from '@ngrx/router-store';
import { CollapseMenuAction } from '../shared/menu/menu.actions';
import { MenuID } from '../shared/menu/initial-menus-state';
describe('NavbarEffects', () => {
let navbarEffects: NavbarEffects;
@@ -28,7 +29,7 @@ describe('NavbarEffects', () => {
it('should return a COLLAPSE action in response to a RESIZE action', () => {
actions = hot('--a-', { a: new HostWindowResizeAction(800, 600) });
const expected = cold('--b-', { b: new NavbarCollapseAction() });
const expected = cold('--b-', { b: new CollapseMenuAction(MenuID.PUBLIC) });
expect(navbarEffects.resize$).toBeObservable(expected);
});
@@ -40,7 +41,7 @@ describe('NavbarEffects', () => {
it('should return a COLLAPSE action in response to an UPDATE_LOCATION action', () => {
actions = hot('--a-', { a: { type: fromRouter.ROUTER_NAVIGATION } });
const expected = cold('--b-', { b: new NavbarCollapseAction() });
const expected = cold('--b-', { b: new CollapseMenuAction(MenuID.PUBLIC) });
expect(navbarEffects.routeChange$).toBeObservable(expected);
});