-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tests: IE<11 does not understand const/let * tests: specify all required initEvent arguments for (IE) Otherwise we get: TypeError: Argument not optional * tests: add profiles to emulate legacy IE versions in IE11 I can confirm that only IE10 profile is working. Sample commandline: npm run test-nolint -- --browsers IE,IE10 * tests: consider that style.zIndex is Number type in IE * tests: set container height explicitly to fix 6 tests failing in IE in IE when container.style.height is not set, container.clientWidth is always 0, despite container.style.width value. * tests: fix #preventDefault in IE Event properties is not preserved across different listeners calls in IE, so we have to make all checks in the same listener. Also: control case added. Note: previously here used to be different implementation that was also reliable, as it relied on return value of https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent ``` function dispatchClick(el) { // return: cancelled if (document.createEvent) { var e = document.createEvent('MouseEvents'); e.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return el.dispatchEvent(e); } else if (el.fireEvent) { // IE<11 return el.fireEvent('onclick'); } } it('prevents the default action of event', function () { expect(dispatchClick(el)).to.be.ok(); // control case L.DomEvent.on(el, 'click', L.DomEvent.preventDefault); expect(dispatchClick(el)).to.not.be.ok(); }); ``` * tests: skip crossOrigin-related tests in IE<11 https://caniuse.com/mdn-html_elements_img_crossorigin
- Loading branch information
johnd0e
authored
Nov 1, 2021
1 parent
a4a11f5
commit f018e2d
Showing
6 changed files
with
47 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters