DON'T MERGE: test fix for external service kind selector
Created by: ijsnow
I tried writing a test for the fix for this issue to show an example of how to write tests for react components with react-testing-library
but this proved difficult.
I had to make eventLogger
a prop for this component because a transient import from eventLogger
accesses something on window.context
which is not defined in jest
and typescript was getting angry when I just tried to polyfill window.context
in jest. This change makes the component more modular anyways so that's good.
Once that was solved, I ran into an issue complaining about not being able to find the monaco-editor
module. This is likely due to the magic we're doing around loading it for performance. We'll probably have to use webpack with jest to map the module like we do in our build process. This will likely slow down jest but will be a requirement if we want to test components using the monaco editor.
I'll open issues for the takeaways from this experience.