/opt/canhelp/node_modules/leaflet.markercluster/spec/suites
NameSizeModeActions
AddLayer.MultipleSpec.js47380755editdlrm
AddLayer.SingleSpec.js29280755editdlrm
AddLayersSpec.js45340755editdlrm
animateOptionSpec.js38430755editdlrm
ChildChangingIconSupportSpec.js14620755editdlrm
CircleMarkerSupportSpec.js39250755editdlrm
CircleSupportSpec.js37920755editdlrm
clearLayersSpec.js14110755editdlrm
disableClusteringAtZoomSpec.js14390755editdlrm
DistanceGridSpec.js10310755editdlrm
eachLayerSpec.js15570755editdlrm
eventsSpec.js97470755editdlrm
getBoundsSpec.js39860755editdlrm
getLayersSpec.js19200755editdlrm
getVisibleParentSpec.js16980755editdlrm
LeafletSpec.js1590755editdlrm
markerMoveSupportSpec.js16570755editdlrm
nonIntegerZoomSpec.js12340755editdlrm
NonPointSpec.js63310755editdlrm
onAddSpec.js13390755editdlrm
onRemoveSpec.js11170755editdlrm
PaneSpec.js15700755editdlrm
QuickHullSpec.js14220755editdlrm
RefreshSpec.js129290755editdlrm
RememberOpacity.js41700755editdlrm
RemoveLayerSpec.js49750755editdlrm
removeLayersSpec.js45340755editdlrm
removeOutsideVisibleBoundsSpec.js72340755editdlrm
singleMarkerModeSpec.js17050755editdlrm
SpecHelper.js6410755editdlrm
spiderfySpec.js88510755editdlrm
supportNegativeZoomSpec.js23740755editdlrm
unspiderfySpec.js28060755editdlrm
zoomAnimationSpec.js126230755editdlrm
Edit: /opt/canhelp/node_modules/leaflet.markercluster/spec/suites/animateOptionSpec.js (3843B)
describe('animate option', function () { ///////////////////////////// // SETUP FOR EACH TEST ///////////////////////////// var div, map, group; beforeEach(function () { div = document.createElement('div'); div.style.width = '200px'; div.style.height = '200px'; document.body.appendChild(div); map = L.map(div, { maxZoom: 18, trackResize: false }); // Corresponds to zoom level 8 for the above div dimensions. map.fitBounds(new L.LatLngBounds([ [1, 1], [2, 2] ])); }); afterEach(function () { if (group instanceof L.MarkerClusterGroup) { group.removeLayers(group.getLayers()); map.removeLayer(group); } map.remove(); div.remove(); div = map = group = null; }); ///////////////////////////// // TESTS ///////////////////////////// it('hooks animated methods version by default', function () { // Need to add to map so that we have the top cluster level created. group = L.markerClusterGroup().addTo(map); var withAnimation = L.MarkerClusterGroup.prototype._withAnimation; // MCG animated methods. expect(group._animationStart).to.be(withAnimation._animationStart); expect(group._animationZoomIn).to.be(withAnimation._animationZoomIn); expect(group._animationZoomOut).to.be(withAnimation._animationZoomOut); expect(group._animationAddLayer).to.be(withAnimation._animationAddLayer); // MarkerCluster spiderfy animated methods var cluster = group._topClusterLevel; withAnimation = L.MarkerCluster.prototype; expect(cluster._animationSpiderfy).to.be(withAnimation._animationSpiderfy); expect(cluster._animationUnspiderfy).to.be(withAnimation._animationUnspiderfy); }); it('hooks non-animated methods version when set to false', function () { // Need to add to map so that we have the top cluster level created. group = L.markerClusterGroup({animate: false}).addTo(map); var noAnimation = L.MarkerClusterGroup.prototype._noAnimation; // MCG non-animated methods. expect(group._animationStart).to.be(noAnimation._animationStart); expect(group._animationZoomIn).to.be(noAnimation._animationZoomIn); expect(group._animationZoomOut).to.be(noAnimation._animationZoomOut); expect(group._animationAddLayer).to.be(noAnimation._animationAddLayer); // MarkerCluster spiderfy non-animated methods var cluster = group._topClusterLevel; noAnimation = L.MarkerClusterNonAnimated.prototype; expect(cluster._animationSpiderfy).to.be(noAnimation._animationSpiderfy); expect(cluster._animationUnspiderfy).to.be(noAnimation._animationUnspiderfy); }); it('always hooks non-animated methods version when L.DomUtil.TRANSITION is false', function () { // Fool Leaflet, make it think the browser does not support transitions. var realDomUtil = L.DomUtil; var fakeDomUtil = {}; for (k in realDomUtil) { fakeDomUtil[k] = realDomUtil[k]; } fakeDomUtil.TRANSITION = false; L.DomUtil = fakeDomUtil; try { // Need to add to map so that we have the top cluster level created. group = L.markerClusterGroup({animate: true}).addTo(map); var noAnimation = L.MarkerClusterGroup.prototype._noAnimation; // MCG non-animated methods. expect(group._animationStart).to.be(noAnimation._animationStart); expect(group._animationZoomIn).to.be(noAnimation._animationZoomIn); expect(group._animationZoomOut).to.be(noAnimation._animationZoomOut); expect(group._animationAddLayer).to.be(noAnimation._animationAddLayer); // MarkerCluster spiderfy non-animated methods var cluster = group._topClusterLevel; noAnimation = L.MarkerClusterNonAnimated.prototype; expect(cluster._animationSpiderfy).to.be(noAnimation._animationSpiderfy); expect(cluster._animationUnspiderfy).to.be(noAnimation._animationUnspiderfy); } finally { //Undo the DomUtil replacement hack L.DomUtil = realDomUtil; } }); });