Sha256: 4ec23b0f8370fa9e44251f393e324928b8dc229c676132a5d34279a8692a8446

Contents?: true

Size: 1.62 KB

Versions: 6

Compression:

Stored size: 1.62 KB

Contents

describe('CircleMarker', function () {
	describe("#_radius", function () {
		var map;
		beforeEach(function () {
			map = L.map(document.createElement('div'));
			map.setView([0, 0], 1);
		});
		describe("when a CircleMarker is added to the map ", function () {
			describe("with a radius set as an option", function () {
				it("takes that radius", function () {
					var marker = L.circleMarker([0, 0], { radius: 20 }).addTo(map);

					expect(marker._radius).to.be(20);
				});
			});

			describe("and radius is set before adding it", function () {
				it("takes that radius", function () {
					var marker = L.circleMarker([0, 0], { radius: 20 });
					marker.setRadius(15);
					marker.addTo(map);
					expect(marker._radius).to.be(15);
				});
			});

			describe("and radius is set after adding it", function () {
				it("takes that radius", function () {
					var marker = L.circleMarker([0, 0], { radius: 20 });
					marker.addTo(map);
					marker.setRadius(15);
					expect(marker._radius).to.be(15);
				});
			});

			describe("and setStyle is used to change the radius after adding", function () {
				it("takes the given radius", function () {
					var marker = L.circleMarker([0, 0], { radius: 20 });
					marker.addTo(map);
					marker.setStyle({ radius: 15 });
					expect(marker._radius).to.be(15);
				});
			});
			describe("and setStyle is used to change the radius before adding", function () {
				it("takes the given radius", function () {
					var marker = L.circleMarker([0, 0], { radius: 20 });
					marker.setStyle({ radius: 15 });
					marker.addTo(map);
					expect(marker._radius).to.be(15);
				});
			});
		});
	});
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
leaflet-js-0.8.dev2 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js
leaflet-js-0.7.0.4 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js
leaflet-js-0.7.0.3 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js
leaflet-js-0.7.0.2 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js
leaflet-js-0.7.0.1 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js
leaflet-js-0.7.0 lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js