-
Notifications
You must be signed in to change notification settings - Fork 379
worked test for LMarker with parent LMap #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@bezany thanks for the help. This looks like a step in the right direction, but I'm not sure if we're all the way there yet. I've only had fifteen minutes to check on this over the weekend, so maybe I've just missed something. I'll put more time into it tomorrow. For some reason, I also haven't tested any of the other wrapper functions other than @DonNicoJs as for how to merge this, I'm happy to get this test in #365 once we sort out any remaining issues, so it all comes as one bundle, or if you want to merge it now then I can pull the changes in from there. Whatever you think is best. |
with root map
@mikeu I did refactoring |
@DonNicoJs I think you can merge this PR. After this @mikeu continue write unit tests. |
@bezany Good point about what the component render functions return... The LControlZoom I'd been working with is even worse, it just always returns I previously had other approaches that gave the same functionality by having two different wrappers, one for the map and one for the component under test, but I was hoping for a single one. As I said in #365, I was ideally looking to have a single wrapper that provided all of the functionality we'd normally expect for components that could truly be mounted in isolation. I guess what this shows is that that was never going to be possible, since at least some of the components we want to test do not actually render themselves at all, but instead affect what their parent renders. Thanks for pointing that out! @DonNicoJs I have integrated a version of @bezany's function to return two wrappers, one for the map and one for the component, into the latest addition to #365. I made the minor change of testing whether the component to be mounted already had a |
Oh sorry @bezany , I didn't notice that you'd commented while I was working. Sure, @DonNicoJs if you want to merge this as @bezany suggests, then I can pull the updates into my other branch and keep going from there. That sounds good to me. |
Help for #365
I found solution how mocked $parent as LMap when test other maps components.
Use parentComponent not worked.
Found worked solution here.