skipIfNotTouch instead of overriding Browser.touch (#5869)
This commit is contained in:
parent
b5cc500de6
commit
f83b5347f5
@ -253,21 +253,16 @@ describe('Tooltip', function () {
|
||||
expect(map.hasLayer(layer._tooltip)).to.be(true);
|
||||
});
|
||||
|
||||
it("is opened when tapping on touch", function () {
|
||||
var oldTouch = L.Browser.touch;
|
||||
L.Browser.touch = true;
|
||||
it.skipIfNotTouch("is opened when tapping on touch", function () {
|
||||
var layer = new L.Marker(center).addTo(map);
|
||||
|
||||
layer.bindTooltip('Tooltip');
|
||||
expect(map.hasLayer(layer._tooltip)).to.be(false);
|
||||
happen.click(layer._icon);
|
||||
expect(map.hasLayer(layer._tooltip)).to.be(true);
|
||||
L.Browser.touch = oldTouch;
|
||||
});
|
||||
|
||||
it("is closed if not permanent when clicking on the map elsewhere on touch", function () {
|
||||
var oldTouch = L.Browser.touch;
|
||||
L.Browser.touch = true;
|
||||
it.skipIfNotTouch("is closed if not permanent when clicking on the map elsewhere on touch", function () {
|
||||
var layer = new L.Marker(center).addTo(map);
|
||||
|
||||
layer.bindTooltip('Tooltip');
|
||||
@ -275,7 +270,6 @@ describe('Tooltip', function () {
|
||||
expect(map.hasLayer(layer._tooltip)).to.be(true);
|
||||
happen.click(map._container);
|
||||
expect(map.hasLayer(layer._tooltip)).to.be(false);
|
||||
L.Browser.touch = oldTouch;
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user