blob: 9ebb05515c344296fcee2b388b91be1d071fe8aa [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 { GridFailuresResolver } from '@pages/grid-failure//grid-failure.resolver';
describe('GridFailuresResolver', () => {
let component: GridFailuresResolver;
let sandbox: any;
beforeEach(() => {
sandbox = {
clear() {},
loadGridFailures() {},
loadGridFailure() {},
} as any;
});
beforeEach(() => {
component = new GridFailuresResolver(sandbox);
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should call loadGridFailures', () => {
const spy = spyOn(sandbox, 'loadGridFailures');
let ar: any = { params: { gridFailureId: undefined } };
component.resolve(ar);
expect(spy).toHaveBeenCalled();
});
it('should call loadGridFailure', () => {
const spy = spyOn(sandbox, 'loadGridFailure');
let ar: any = { params: { gridFailureId: '6432a9c9-0384-44af-9bb8-34f2878d7b49' } };
component.resolve(ar);
expect(spy).toHaveBeenCalled();
});
});