# Code coverage report for ./suites/layer/vector/CircleMarkerSpec.js

## Statements: 100% (35 / 35) Branches: 100% (0 / 0) Functions: 100% (14 / 14) Lines: 100% (35 / 35)

All files » ./suites/layer/vector/ » CircleMarkerSpec.js

    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
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    541
    1
    1
    1
    5
    5

    1
    1
    1
    1

    1

    1
    1
    1
    1
    1
    1

    1
    1
    1
    1
    1
    1

    1
    1
    1
    1
    1
    1

    1
    1
    1
    1
    1
    1

     ﻿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);
    				});
    			});
    		});
    	});
    });