blob: 1d66cb44c715cb10a445c47f4ffe4b09fc110559 [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { GridFailureSandbox } from '@pages/grid-failure/grid-failure.sandbox';
import { Store, ActionsSubject } from '@ngrx/store';
import { State } from '@shared/store';
import { of } from 'rxjs';
import * as gridFailureActions from '@shared/store/actions/grid-failures.action';
describe('GridFailureSandbox', () => {
let service: GridFailureSandbox;
let appState: Store<State>;
let actionSubject: ActionsSubject;
beforeEach(() => {
appState = { dispatch: () => {}, pipe: () => of(true), select: () => of(true) } as any;
actionSubject = { pipe: () => of(true) } as any;
spyOn(appState, 'dispatch').and.callFake(() => {});
service = new GridFailureSandbox(appState, actionSubject);
});
it('should create GridFailureSandbox service', () => {
expect(service).toBeTruthy();
});
it('should dispatch loadGridFailures Action via loadGridFailures()', () => {
service.loadGridFailures();
expect(appState.dispatch).toHaveBeenCalledWith(gridFailureActions.loadGridFailures());
});
});