JonathanExcelsior
How does Solid attach event handlers to DOM elements?
I see. It seems I have to think about testing differently then.
I'm currently testing the component in isolation and wanted to test that the component doesn't have the event handler under certain conditions and does otherwise (based on props).
Testing what I expect to happen would be more of an integration test with other components.
I did ask in the testing channel if there is a comprehensive guide to testing a SolidJS application as I'm not sure how to effectively test following the philosophy I mentioned in my last message.
I am still curious how Solid attaches event handlers to DOM elements though.
Thanks for your help!
8 replies
How does Solid attach event handlers to DOM elements?
@zulu
Great question.
I used the method you mentioned prior. I tested if the event handler was called.
However, I'm trying to follow the "test your application how it should be used, not implementation details" philosophy. Which means testing DOM elements more or less. Testing if the event handler was called is an implementation detail.
Unless I'm thinking about this incorrectly 🤷🏾♂️
8 replies