elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.47k stars 8.04k forks source link

[ML] Migrate tests using `enzyme` to use `@testing-library/react`. #153288

Open walterra opened 1 year ago

walterra commented 1 year ago

At the moment it looks like to be able to migrate to React 18, we need to migrate tests using enzyme to @testing-library/react, since Enzyme officially supporting React 18 looks still unlikely (see e.g. https://github.com/enzymejs/enzyme/issues/2524, https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl). When porting these tests, we should also try to avoid the use of existing snapshots again and refactor to more useful tests that assert rendered content and act on the components so we rely less on implementation details. And since we write new tests with @testing-library/react only anyway, we should aim to migrate these tests so we rely on one framework only eventually.

plugins/ml

plugins/transform

elasticmachine commented 1 year ago

Pinging @elastic/ml-ui (:ml)