mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
AddLayerSpec -> AddLayer.SingleSpec (As it contains tests about adding a single marker). Not sure if this is the right way to organise these tests.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
describe('addLayer', function () {
|
describe('addLayer adding a single marker', function () {
|
||||||
var map, div;
|
var map, div;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
div = document.createElement('div');
|
div = document.createElement('div');
|
||||||
@@ -16,7 +16,9 @@
|
|||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
document.body.removeChild(div);
|
document.body.removeChild(div);
|
||||||
});
|
});
|
||||||
it('adds an individual marker that is added before the group is added to the map', function () {
|
|
||||||
|
|
||||||
|
it('appears when added to the group before the group is added to the map', function () {
|
||||||
|
|
||||||
var group = new L.MarkerClusterGroup();
|
var group = new L.MarkerClusterGroup();
|
||||||
var marker = new L.Marker([1.5, 1.5]);
|
var marker = new L.Marker([1.5, 1.5]);
|
||||||
@@ -27,7 +29,7 @@
|
|||||||
expect(marker._icon).to.not.be(undefined);
|
expect(marker._icon).to.not.be(undefined);
|
||||||
expect(marker._icon.parentNode).to.be(map._panes.markerPane);
|
expect(marker._icon.parentNode).to.be(map._panes.markerPane);
|
||||||
});
|
});
|
||||||
it('adds an individual marker that is added after the group is added to the map', function () {
|
it('appears when added to the group after the group is added to the map', function () {
|
||||||
|
|
||||||
var group = new L.MarkerClusterGroup();
|
var group = new L.MarkerClusterGroup();
|
||||||
var marker = new L.Marker([1.5, 1.5]);
|
var marker = new L.Marker([1.5, 1.5]);
|
||||||
@@ -38,7 +40,7 @@
|
|||||||
expect(marker._icon).to.not.be(undefined);
|
expect(marker._icon).to.not.be(undefined);
|
||||||
expect(marker._icon.parentNode).to.be(map._panes.markerPane);
|
expect(marker._icon.parentNode).to.be(map._panes.markerPane);
|
||||||
});
|
});
|
||||||
it('adds (using animations) an individual marker that is added after the group is added to the map', function () {
|
it('appears (using animations) when added after the group is added to the map', function () {
|
||||||
|
|
||||||
var group = new L.MarkerClusterGroup({ animateAddingMarkers: true });
|
var group = new L.MarkerClusterGroup({ animateAddingMarkers: true });
|
||||||
var marker = new L.Marker([1.5, 1.5]);
|
var marker = new L.Marker([1.5, 1.5]);
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('does not add an individual marker that is too far away that is added before the group is added to the map', function () {
|
it('does not appear when too far away when added before the group is added to the map', function () {
|
||||||
|
|
||||||
var group = new L.MarkerClusterGroup();
|
var group = new L.MarkerClusterGroup();
|
||||||
var marker = new L.Marker([3.5, 1.5]);
|
var marker = new L.Marker([3.5, 1.5]);
|
||||||
@@ -61,7 +63,7 @@
|
|||||||
|
|
||||||
expect(marker._icon).to.be(undefined);
|
expect(marker._icon).to.be(undefined);
|
||||||
});
|
});
|
||||||
it('does not add an individual marker that is too far away that is added after the group is added to the map', function () {
|
it('does not appear when too far away when added after the group is added to the map', function () {
|
||||||
|
|
||||||
var group = new L.MarkerClusterGroup();
|
var group = new L.MarkerClusterGroup();
|
||||||
var marker = new L.Marker([3.5, 1.5]);
|
var marker = new L.Marker([3.5, 1.5]);
|
||||||
Reference in New Issue
Block a user