RaspberryPiFoundation / editor-ui

Code Editor web component
https://editor-static.raspberrypi.org
Apache License 2.0
36 stars 9 forks source link

Investigate test approach #542

Open danhalson opened 1 year ago

danhalson commented 1 year ago

As a result of ongoing complexities around testing, some discussion and thought needs to go into the testing approach. This should be an approach that is shared across apps, but initially the focus is on editor-ui.

Current discussion has centred around the testing approach given via react-testing-library, with the focus on not altering state within the test (as opposed to how enzyme does things), and whether this causes extra complexity and a slightly awkward separation of concerns. However, it could be that a better defined approach to testing certain scenarios could provide a resolution to this...i.e. tool, utils and well defined patterns to aid in mocking the api, creating data, testing state changes, and ui interaction, and ensuring we have a holistic approach that provides good coverage in a performant, and accessible way.

ACs

Tests need adding to design-system-react, so this could act a test bed for some of the following:

MFarringtonRPF commented 1 year ago

Could we pop some notes in here about what the output is on this story? It would be good to document whatever is decided and why.

MFarringtonRPF commented 1 year ago

To be broken down into issues, since the thinking work has been done here.