test(GeoJSON): TDD case markersInheritOptions
see next commit for resolution.
ghybs
4 years ago
29 | 29 | var layer = new L.GeoJSON(); |
30 | 30 | layer.addData(geojsonEmpty); |
31 | 31 | expect(layer.getLayers().length).to.eql(0); |
32 | }); | |
33 | ||
34 | it("makes default marker inherit group options if explicitly requested", function () { | |
35 | // Check first that it does not inherit group options by default | |
36 | var options = { | |
37 | customOption: "My Custom Option" | |
38 | }; | |
39 | var layer = new L.GeoJSON(null, options); | |
40 | layer.addData(geojson); | |
41 | expect(layer.getLayers()[0].options.customOption).to.equal(undefined); | |
42 | ||
43 | // Now make it inherit group options | |
44 | layer.options.markersInheritOptions = true; | |
45 | layer.addData(geojson); | |
46 | expect(layer.getLayers()[1].options.customOption).to.eql(options.customOption); | |
32 | 47 | }); |
33 | 48 | }); |
34 | 49 |