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.

mockDOMSource can't mock events for isolated nested components

See original GitHub issue

There isn’t a way to differentiate events mocked with mockDOMSource, where nested components are listening to events on the same namespace and relying on isolation to differentiate them.

For example, something like: https://jsfiddle.net/25a74k0k/.

The only way I can think to achieve this, is to pass in a custom class to the child (made unique by the parent), add it to the elements being listened to, and then use that custom class when selecting them. However, this is complicating the way a child must be initialised and basically duplicating what we are getting from isolate on the real DOMSource.

Also, in cases where :root is the only selector used, the child would have to wrap the root element in another element to be able to select the custom class, which bloats the mark up.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
staltzcommented, Jul 13, 2016

Done in Cycle DOM v10.1.0

0reactions
staltzcommented, Jun 29, 2016

Lifting this from priority 3 to 4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Testing : Raise Event From Nested Type - Stack Overflow
JustMock.Core.MockException: Unable to deduce which event was specified in the parameter. at Telerik.JustMock.Core.Behaviors.
Read more >
cyclejs/cyclejs - Gitter
Is there a way to differentiate events mocked with mockDOMSource , where nested components are listening for events on the same namespace (especially...
Read more >
Nested Component Unit Testing Lightning Web Components ...
The purpose of unit testing is to ensure each unit of a software package works as designed. This makes test more readable and...
Read more >
A functional and reactive JavaScript framework for predictable ...
DOM Driver isolation and event delegator event Streams based on Element Signals may be a challenging problem.
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