all files / lib/ overlay-layer.directive.spec.js

100% Statements 23/23
100% Branches 0/0
75% Functions 6/8
100% Lines 23/23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                                     
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var index_1 = require("./index");
describe("Overlay-Layer Directive", function () {
    var layerControlProvider = new index_1.LayersControlProvider();
    var overlay;
    var layerProvider = new index_1.LayerProvider();
    layerProvider.ref = {};
    describe("[caption]", function () {
        it("should be changed in Leaflet when changing in Angular", function (done) {
            var val = "my layer";
            layerControlProvider.ref = {
                removeLayer: function () {
                    /* do nothing */
                },
                addOverlay: function (ref, caption) {
                    chai_1.expect(ref).equal(layerProvider.ref);
                    chai_1.expect(caption).equal(val);
                    done();
                },
            };
            overlay = new index_1.OverlayLayerDirective(layerProvider, layerControlProvider);
            overlay.caption = val;
        });
        it("should be readable", function () {
            var val = "my layer";
            layerControlProvider.ref = {
                removeLayer: function () {
                    /* do nothing */
                },
                addBaseLayer: function () {
                    /* do nothing */
                },
            };
            overlay = new index_1.OverlayLayerDirective(layerProvider, layerControlProvider);
            layerControlProvider.ref._layers = [{ layer: layerProvider.ref, name: val }];
            chai_1.expect(overlay.caption).equal(val);
        });
    });
});
//# sourceMappingURL=overlay-layer.directive.spec.js.map