@yaga/leaflet-ng2
Version:
Angular2 module for Leaflet
1,077 lines • 47.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const leaflet_1 = require("leaflet");
const index_1 = require("./index");
const spec_1 = require("./spec");
describe("Map Component", () => {
let map;
beforeEach(() => {
map = new index_1.MapComponent({ nativeElement: document.createElement("div") }, new index_1.LayerGroupProvider(), new index_1.MapProvider());
});
describe("[(lat)]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomLat();
map.lat = val;
chai_1.expect(map.getCenter().lat).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomLat();
map.lat = val;
chai_1.expect(map.lat).to.equal(val);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomLat();
map.setView([val, 0], 0);
chai_1.expect(map.lat).to.equal(val);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomLat();
map.latChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.lat = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomLat();
map.latChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.setView([val, 0], 0);
});
it("should threshold rapid changes in Angular when changing in Leaflet", (done) => {
let alreadyFired = false;
map.latChange.subscribe(() => {
/* istanbul ignore if */
if (alreadyFired) {
return done(new Error("Already fired event"));
}
alreadyFired = true;
return done();
});
map.setView([spec_1.randomLat(), 0], 0);
setTimeout(() => {
map.setView([spec_1.randomLat(), 0], 0);
}, 10);
});
});
describe("[(lng)]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomLng();
map.lng = val;
chai_1.expect(map.getCenter().lng).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomLng();
map.lng = val;
chai_1.expect(map.lng).to.equal(val);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomLng();
map.setView([0, val], 0);
chai_1.expect(map.lng).to.equal(val);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomLng();
map.lngChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.lng = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomLng();
map.lngChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.setView([0, val], 0);
});
it("should threshold rapid changes in Angular when changing in Leaflet", (done) => {
let alreadyFired = false;
map.lngChange.subscribe(() => {
/* istanbul ignore if */
if (alreadyFired) {
return done(new Error("Already fired event"));
}
alreadyFired = true;
return done();
});
map.setView([0, spec_1.randomLng()], 0);
setTimeout(() => {
map.setView([0, spec_1.randomLng()], 0);
}, 10);
});
});
describe("[(zoom)]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.zoom = val;
chai_1.expect(map.getZoom()).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.zoom = val;
chai_1.expect(map.zoom).to.equal(val);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.setView([0, 0], val);
chai_1.expect(map.zoom).to.equal(val);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.zoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.zoom = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.zoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.setView([0, 0], val);
});
it("should threshold rapid changes in Angular when changing in Leaflet", (done) => {
let alreadyFired = false;
map.zoomChange.subscribe(() => {
/* istanbul ignore if */
if (alreadyFired) {
return done(new Error("Already fired event"));
}
alreadyFired = true;
return done();
});
map.setView([0, 0], spec_1.randomNumber(15, 1, 0));
setTimeout(() => {
map.setView([0, 0], spec_1.randomNumber(15, 1, 0));
}, 10);
});
});
describe("[(minZoom)]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.minZoom = val;
chai_1.expect(map.getMinZoom()).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.minZoom = val;
chai_1.expect(map.minZoom).to.equal(val);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.setMinZoom(val);
chai_1.expect(map.minZoom).to.equal(val);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.minZoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.minZoom = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.minZoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.setMinZoom(val);
});
});
describe("[(maxZoom)]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.maxZoom = val;
chai_1.expect(map.getMaxZoom()).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.maxZoom = val;
chai_1.expect(map.maxZoom).to.equal(val);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomNumber(15, 1, 0);
map.setMaxZoom(val);
chai_1.expect(map.maxZoom).to.equal(val);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.maxZoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.maxZoom = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomNumber(15, 1, 0);
map.maxZoomChange.subscribe((eventVal) => {
chai_1.expect(eventVal).to.equal(val);
return done();
});
map.setMaxZoom(val);
});
});
describe("[(maxBounds)]", () => {
beforeEach(() => {
// Fix for no browser-test
map._size = leaflet_1.point(100, 100);
});
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomLatLngBounds();
map.setMaxBounds(val);
chai_1.expect(val.equals(map.options.maxBounds)).to.equal(true);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomLatLngBounds();
map.maxBounds = val;
chai_1.expect(val.equals(map.maxBounds)).to.equal(true);
});
it("should be changed in Angular when changing in Leaflet", () => {
const val = spec_1.randomLatLngBounds();
map.setMaxBounds(val);
chai_1.expect(val.equals(map.maxBounds)).to.equal(true);
});
it("should fire an event when changing in Angular", (done) => {
const val = spec_1.randomLatLngBounds();
map.maxBoundsChange.subscribe((eventVal) => {
chai_1.expect(val.equals(eventVal)).to.equal(true);
return done();
});
map.maxBounds = val;
});
it("should fire an event when changing in Leaflet", (done) => {
const val = spec_1.randomLatLngBounds();
map.maxBoundsChange.subscribe((eventVal) => {
chai_1.expect(val.equals(eventVal)).to.equal(true);
return done();
});
map.setMaxBounds(val);
});
});
// Events
describe("(baselayerchange)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.baselayerchangeEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("baselayerchange", testEvent);
});
});
describe("(overlayadd)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.overlayaddEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("overlayadd", testEvent);
});
});
describe("(overlayremove)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.overlayremoveEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("overlayremove", testEvent);
});
});
describe("(layeradd)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.layeraddEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("layeradd", testEvent);
});
});
describe("(layerremove)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.layerremoveEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("layerremove", testEvent);
});
});
describe("(zoomlevelschange)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.zoomlevelschangeEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("zoomlevelschange", testEvent);
});
});
describe("(resize)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.resizeEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("resize", testEvent);
});
});
describe("(unload)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.unloadEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("unload", testEvent);
});
});
describe("(viewreset)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.viewresetEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("viewreset", testEvent);
});
});
describe("(load)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.loadEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("load", testEvent);
});
});
describe("(zoomstart)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.zoomstartEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("zoomstart", testEvent);
});
});
describe("(movestart)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.movestartEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("movestart", testEvent);
});
});
describe("(zoom)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.zoomEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("zoom", testEvent);
});
});
describe("(move)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.moveEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("move", testEvent);
});
});
describe("(boxzoomstart)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.boxzoomstartEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("boxzoomstart", testEvent);
});
});
describe("(boxzoomend)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.boxzoomendEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("boxzoomend", testEvent);
});
});
describe("(zoomend)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.zoomendEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("zoomend", testEvent);
});
});
describe("(moveend)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.moveendEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("moveend", testEvent);
});
});
describe("(popupopen)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.popupopenEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("popupopen", testEvent);
});
});
describe("(popupclose)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.popupcloseEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("popupclose", testEvent);
});
});
describe("(autopanstart)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.autopanstartEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("autopanstart", testEvent);
});
});
describe("(tooltipopen)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.tooltipopenEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("tooltipopen", testEvent);
});
});
describe("(tooltipclose)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.tooltipcloseEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("tooltipclose", testEvent);
});
});
describe("(click)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.clickEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("click", testEvent);
});
});
describe("(dblclick)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
map.doubleClickZoom.disable();
const testHandle = {};
const testEvent = { testHandle, originalEvent: { shiftKey: false } };
map.dblclickEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("dblclick", testEvent);
});
});
describe("(mousedown)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.mousedownEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("mousedown", testEvent);
});
});
describe("(mouseup)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.mouseupEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("mouseup", testEvent);
});
});
describe("(mouseover)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.mouseoverEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("mouseover", testEvent);
});
});
describe("(mouseout)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.mouseoutEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("mouseout", testEvent);
});
});
describe("(mousemove)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.mousemoveEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("mousemove", testEvent);
});
});
describe("(contextmenu)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.contextmenuEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("contextmenu", testEvent);
});
});
describe("(keypress)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.keypressEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("keypress", testEvent);
});
});
describe("(preclick)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle };
map.preclickEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("preclick", testEvent);
});
});
describe("(zoomanim)", () => {
it("should fire event in Angular when firing event in Leaflet", (done) => {
const testHandle = {};
const testEvent = { testHandle, center: { lat: 1, lng: 1 }, zoom: 1 };
map.zoomanimEvent.subscribe((event) => {
chai_1.expect(event.testHandle).to.equal(testEvent.testHandle);
return done();
});
map.fire("zoomanim", testEvent);
});
});
describe("[closePopupOnClick]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.closePopupOnClick = false;
chai_1.expect(map.options.closePopupOnClick).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.closePopupOnClick = false;
map.closePopupOnClick = true;
chai_1.expect(map.options.closePopupOnClick).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.closePopupOnClick = false;
chai_1.expect(map.closePopupOnClick).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.closePopupOnClick = true;
chai_1.expect(map.closePopupOnClick).to.equal(true);
});
});
describe("[zoomSnap]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 0, 1);
map.zoomSnap = val;
chai_1.expect(map.options.zoomSnap !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 0, 1);
map.zoomSnap = val;
chai_1.expect(map.zoomSnap !== val).to.equal(false);
});
});
describe("[zoomDelta]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 0, 1);
map.zoomDelta = val;
chai_1.expect(map.options.zoomDelta !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 0, 1);
map.zoomDelta = val;
chai_1.expect(map.zoomDelta !== val).to.equal(false);
});
});
describe("[trackResize]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.trackResize = false;
chai_1.expect(map.options.trackResize).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.trackResize = false;
map.trackResize = true;
chai_1.expect(map.options.trackResize).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.trackResize = false;
chai_1.expect(map.trackResize).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.trackResize = true;
chai_1.expect(map.trackResize).to.equal(true);
});
});
describe("[boxZoomEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.boxZoomEnabled = false;
chai_1.expect(map.boxZoom.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.boxZoom.disable();
map.boxZoomEnabled = true;
chai_1.expect(map.boxZoom.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.boxZoomEnabled = false;
chai_1.expect(map.boxZoomEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.boxZoomEnabled = true;
chai_1.expect(map.boxZoomEnabled).to.equal(true);
});
});
describe("[doubleClickZoomEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.doubleClickZoomEnabled = false;
chai_1.expect(map.doubleClickZoom.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.doubleClickZoom.disable();
map.doubleClickZoomEnabled = true;
chai_1.expect(map.doubleClickZoom.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.doubleClickZoomEnabled = false;
chai_1.expect(map.doubleClickZoomEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.doubleClickZoomEnabled = true;
chai_1.expect(map.doubleClickZoomEnabled).to.equal(true);
});
});
describe("[draggingEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.draggingEnabled = false;
chai_1.expect(map.dragging.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.dragging.disable();
map.draggingEnabled = true;
chai_1.expect(map.dragging.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.draggingEnabled = false;
chai_1.expect(map.draggingEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.draggingEnabled = true;
chai_1.expect(map.draggingEnabled).to.equal(true);
});
});
describe("[fadeAnimation]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.fadeAnimation = false;
chai_1.expect(map.options.fadeAnimation).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.fadeAnimation = false;
map.fadeAnimation = true;
chai_1.expect(map.options.fadeAnimation).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.fadeAnimation = false;
chai_1.expect(map.fadeAnimation).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.fadeAnimation = true;
chai_1.expect(map.fadeAnimation).to.equal(true);
});
});
describe("[markerZoomAnimation]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.markerZoomAnimation = false;
chai_1.expect(map.options.markerZoomAnimation).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.markerZoomAnimation = false;
map.markerZoomAnimation = true;
chai_1.expect(map.options.markerZoomAnimation).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.markerZoomAnimation = false;
chai_1.expect(map.markerZoomAnimation).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.markerZoomAnimation = true;
chai_1.expect(map.fadeAnimation).to.equal(true);
});
});
describe("[transform3DLimit]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.transform3DLimit = val;
chai_1.expect(map.options.transform3DLimit !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.transform3DLimit = val;
chai_1.expect(map.transform3DLimit !== val).to.equal(false);
});
});
describe("[zoomAnimation]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.zoomAnimation = false;
chai_1.expect(map.options.zoomAnimation).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.zoomAnimation = false;
map.zoomAnimation = true;
chai_1.expect(map.options.zoomAnimation).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.zoomAnimation = false;
chai_1.expect(map.zoomAnimation).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.zoomAnimation = true;
chai_1.expect(map.zoomAnimation).to.equal(true);
});
});
describe("[zoomAnimationThreshold]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.zoomAnimationThreshold = val;
chai_1.expect(map.options.zoomAnimationThreshold !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.zoomAnimationThreshold = val;
chai_1.expect(map.zoomAnimationThreshold !== val).to.equal(false);
});
});
describe("[inertia]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.inertia = false;
chai_1.expect(map.options.inertia).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.inertia = false;
map.inertia = true;
chai_1.expect(map.options.inertia).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.inertia = false;
chai_1.expect(map.inertia).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.inertia = true;
chai_1.expect(map.inertia).to.equal(true);
});
});
describe("[inertiaDeceleration]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.inertiaDeceleration = val;
chai_1.expect(map.options.inertiaDeceleration !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.inertiaDeceleration = val;
chai_1.expect(map.inertiaDeceleration !== val).to.equal(false);
});
});
describe("[inertiaMaxSpeed]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.inertiaMaxSpeed = val;
chai_1.expect(map.options.inertiaMaxSpeed !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.inertiaMaxSpeed = val;
chai_1.expect(map.inertiaMaxSpeed !== val).to.equal(false);
});
});
describe("[easeLinearity]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.easeLinearity = val;
chai_1.expect(map.options.easeLinearity !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.easeLinearity = val;
chai_1.expect(map.easeLinearity !== val).to.equal(false);
});
});
describe("[worldCopyJump]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.worldCopyJump = false;
chai_1.expect(map.options.worldCopyJump).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.worldCopyJump = false;
map.worldCopyJump = true;
chai_1.expect(map.options.worldCopyJump).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.worldCopyJump = false;
chai_1.expect(map.worldCopyJump).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.worldCopyJump = true;
chai_1.expect(map.worldCopyJump).to.equal(true);
});
});
describe("[maxBoundsViscosity]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.maxBoundsViscosity = val;
chai_1.expect(map.options.maxBoundsViscosity !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.maxBoundsViscosity = val;
chai_1.expect(map.maxBoundsViscosity !== val).to.equal(false);
});
});
describe("[keyboardEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.keyboardEnabled = false;
chai_1.expect(map.keyboard.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.keyboard.disable();
map.keyboardEnabled = true;
chai_1.expect(map.keyboard.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.keyboardEnabled = false;
chai_1.expect(map.keyboardEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.keyboardEnabled = true;
chai_1.expect(map.keyboardEnabled).to.equal(true);
});
});
describe("[keyboardPanDelta]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.keyboardPanDelta = val;
chai_1.expect(map.options.keyboardPanDelta !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.keyboardPanDelta = val;
chai_1.expect(map.keyboardPanDelta !== val).to.equal(false);
});
});
describe("[scrollWheelZoomEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.scrollWheelZoomEnabled = false;
chai_1.expect(map.scrollWheelZoom.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.scrollWheelZoom.disable();
map.scrollWheelZoomEnabled = true;
chai_1.expect(map.scrollWheelZoom.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.scrollWheelZoomEnabled = false;
chai_1.expect(map.scrollWheelZoomEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.scrollWheelZoomEnabled = true;
chai_1.expect(map.scrollWheelZoomEnabled).to.equal(true);
});
});
describe("[wheelDebounceTime]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.wheelDebounceTime = val;
chai_1.expect(map.options.wheelDebounceTime !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.wheelDebounceTime = val;
chai_1.expect(map.wheelDebounceTime !== val).to.equal(false);
});
});
describe("[wheelPxPerZoomLevel]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.wheelPxPerZoomLevel = val;
chai_1.expect(map.options.wheelPxPerZoomLevel !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.wheelPxPerZoomLevel = val;
chai_1.expect(map.wheelPxPerZoomLevel !== val).to.equal(false);
});
});
describe("[tapTolerance]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.tapTolerance = val;
chai_1.expect(map.options.tapTolerance !== val).to.equal(false);
});
it("should be changed in Angular when changing in Angular", () => {
const val = spec_1.randomNumber(10, 1, 0);
map.tapTolerance = val;
chai_1.expect(map.tapTolerance !== val).to.equal(false);
});
});
describe("[tapEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.tapEnabled = false;
chai_1.expect(map.options.tap).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.tap = false;
map.tapEnabled = true;
chai_1.expect(map.options.tap).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.tapEnabled = false;
chai_1.expect(map.tapEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.tapEnabled = true;
chai_1.expect(map.tapEnabled).to.equal(true);
});
});
describe("[bounceAtZoomLimits]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.bounceAtZoomLimits = false;
chai_1.expect(map.options.bounceAtZoomLimits).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.options.bounceAtZoomLimits = false;
map.bounceAtZoomLimits = true;
chai_1.expect(map.options.bounceAtZoomLimits).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.bounceAtZoomLimits = false;
chai_1.expect(map.bounceAtZoomLimits).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.bounceAtZoomLimits = true;
chai_1.expect(map.bounceAtZoomLimits).to.equal(true);
});
});
describe("[touchZoomEnabled]", () => {
it("should be changed to false in Leaflet when changing in Angular to false", () => {
map.touchZoomEnabled = false;
chai_1.expect(map.touchZoom.enabled()).to.equal(false);
});
it("should be changed to true in Leaflet when changing in Angular to true", () => {
map.touchZoom.disable();
map.touchZoomEnabled = true;
chai_1.expect(map.touchZoom.enabled()).to.equal(true);
});
it("should be changed in Angular to false when changing in Angular to false", () => {
map.touchZoomEnabled = false;
chai_1.expect(map.touchZoomEnabled).to.equal(false);
});
it("should be changed in Angular to true when changing in Angular to true", () => {
map.touchZoomEnabled = true;
chai_1.expect(map.touchZoomEnabled).to.equal(true);
});
});
describe("[crs]", () => {
it("should be changed in Leaflet when changing in Angular", () => {
const val = leaflet_1.CRS.Simple;
map.crs = val;
chai_1.expect(map.options.crs).to.equal(val);
});
it("should be changed in Angular when changing in Angular", () => {
const val = leaflet_1.CRS.Simple;
map.crs = val;
chai_1.expect(map.crs).to.equal(val);
});
});
});
//# sourceMappingURL=map.component.spec.js.map