From a656a0b9ecbcf4eda8912d0f281fcfdf26d272fb Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Fri, 11 Nov 2016 15:54:05 +0100 Subject: [PATCH] Add unit test --- spec/suites/control/Control.LayersSpec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/suites/control/Control.LayersSpec.js b/spec/suites/control/Control.LayersSpec.js index 5ebb7eff..1f85f613 100644 --- a/spec/suites/control/Control.LayersSpec.js +++ b/spec/suites/control/Control.LayersSpec.js @@ -128,4 +128,16 @@ describe("Control.Layers", function () { }); }); + describe("is created with an expand link", function () { + it("when collapsed", function () { + var layersCtrl = L.control.layers(null, null, {collapsed: true}).addTo(map); + expect(map._container.querySelector('.leaflet-control-layers-toggle')).to.be.ok(); + }); + + it("when not collapsed", function () { + var layersCtrl = L.control.layers(null, null, {collapsed: false}).addTo(map); + expect(map._container.querySelector('.leaflet-control-layers-toggle')).to.be.ok(); + }); + }); + });