question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DomEvent functions not covered by tests

See original GitHub issue

We have some DomEvent tests here: https://github.com/Leaflet/Leaflet/blob/master/spec/suites/dom/DomEventSpec.js, but not all functions are covered.

Here the list of lacking tests:

  1. on(<HTMLElement> el, <String> types, <Function> fn, <Object> context?) (where types has several events)
  2. on(<HTMLElement> el, <Object> eventMap, <Object> context?)
  3. off(<HTMLElement> el, <String> types, <Function> fn, <Object> context?) (where types has several events)
  4. off(<HTMLElement> el, <Object> eventMap, <Object> context?)

Note: some on/off tests implemented in #7125.

  1. stop(<DOMEvent> ev)
  2. getMousePosition(<DOMEvent> ev, <HTMLElement> container?)
  3. getWheelDelta(<DOMEvent> ev)

Ref: https://leafletjs.com/reference-1.7.1.html#domevent

Note: When implementing required test cases consider minor refactoring in #7438 (which already has tests for disableScrollPropagation and disableClickPropagation).


Related:

  • DomEvent.DoubleTap.js is covered by #7027.
  • DomEvent.Pointer.js is covered by #7415.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
johnd0ecommented, Jan 30, 2021

See also #7126.

0reactions
Crimson-riotcommented, Feb 4, 2021

Ok, #7453 is up and based on #7438 but it seems like I cannot link that PR to this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing a mock DOM event to component method in Angular ...
I cannot find a way to pass the event object to the method in the unit test case for example: test('it should call...
Read more >
Listen To The Application Events From Cypress Tests
This blog post shows how to receive the custom DOM events and jQuery events. In every case, it is important to set up...
Read more >
Testing Components – Testing Angular
Introduction to testing Angular Components with Angular's TestBed. ... that triggerEventHandler does not dispatch a synthetic DOM event.
Read more >
.dispatchEvent() | TestController | Test API | API | Docs
dispatchEvent method in Internet Explorer, since IE does not support event constructors. Fires a DOM event at the specified target . Use the...
Read more >
Component testing scenarios - Angular
There is no nested syntax (like a Promise.then() ) to disrupt the flow of control. Limitation: The fakeAsync() function won't work if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found