Test cases for #1297 circleMarker setRadius issue.
This commit is contained in:
parent
d1eb21850c
commit
b905708f24
@ -44,6 +44,7 @@
|
||||
|
||||
<!-- /layer -->
|
||||
<script type="text/javascript" src="suites/layer/TileLayerSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/layer/marker/CircleMarkerSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/layer/vector/PolylineGeometrySpec.js"></script>
|
||||
<script type="text/javascript" src="suites/layer/vector/CircleSpec.js"></script>
|
||||
|
||||
|
41
spec/suites/layer/marker/CircleMarkerSpec.js
Normal file
41
spec/suites/layer/marker/CircleMarkerSpec.js
Normal file
@ -0,0 +1,41 @@
|
||||
describe('CircleMarker', function() {
|
||||
describe("#_radius", function() {
|
||||
var map;
|
||||
beforeEach(function() {
|
||||
map = L.map(document.createElement('div'));
|
||||
});
|
||||
describe("when a CircleMarker is added to the map ", function() {
|
||||
describe("with a radius set as an option", function() {
|
||||
it("should take that radius", function() {
|
||||
map.setView([0, 0], 1);
|
||||
|
||||
var marker = L.circleMarker([0, 0], { radius: 20 }).addTo(map);
|
||||
|
||||
expect(marker._radius).toBe(20);
|
||||
});
|
||||
});
|
||||
|
||||
describe("and radius is set before adding it", function () {
|
||||
it("should take that radius", function () {
|
||||
map.setView([0, 0], 1);
|
||||
|
||||
var marker = L.circleMarker([0, 0], { radius: 20 });
|
||||
marker.setRadius(15);
|
||||
marker.addTo(map);
|
||||
expect(marker._radius).toBe(15);
|
||||
});
|
||||
});
|
||||
|
||||
describe("and radius is set after adding it", function () {
|
||||
it("should take that radius", function () {
|
||||
map.setView([0, 0], 1);
|
||||
|
||||
var marker = L.circleMarker([0, 0], { radius: 20 });
|
||||
marker.addTo(map);
|
||||
marker.setRadius(15);
|
||||
expect(marker._radius).toBe(15);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -33,6 +33,7 @@ files = [].concat([
|
||||
"suites/dom/DomEventSpec.js",
|
||||
"suites/dom/DomUtilSpec.js",
|
||||
"suites/layer/TileLayerSpec.js",
|
||||
"suites/layer/marker/CircleMarkerSpec.js",
|
||||
"suites/layer/vector/PolylineGeometrySpec.js",
|
||||
"suites/layer/vector/CircleSpec.js",
|
||||
"suites/map/MapSpec.js"
|
||||
|
Loading…
Reference in New Issue
Block a user