blob: dd5e766823ea53be38165f6208d0821e51a8eace [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 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import {async, ComponentFixture, TestBed} from "@angular/core/testing";
import {I18nModule} from "../../../../core";
import {MapSelectModule} from "../map-select.module";
import {MapSelectComponent} from "./map-select.component";
describe("MapSelectComponent", () => {
let component: MapSelectComponent;
let fixture: ComponentFixture<MapSelectComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MapSelectModule, I18nModule]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MapSelectComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it("should select a new value", () => {
const value = "52.520008,13.404954,11";
const valueEmitSpy = spyOn(component.appValueChange, "emit");
const onChangeSpy = spyOn(component, "onChange");
const onTouchSpy = spyOn(component, "onTouch");
component.select(value);
expect(valueEmitSpy).toHaveBeenCalledWith(value);
expect(onChangeSpy).toHaveBeenCalledWith(value);
expect(onTouchSpy).toHaveBeenCalledWith();
});
});