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:
[ ] A decision on which testing library (libraries) we move forward with, i.e. Enzyme, React testing library, or something else?
[ ] An approach for test data creation, what this looks like and where it lives
[ ] An approach (ideally with a simple prototype) of a util library that has tools to approach common testing scenarios / patterns, i.e. mocks, state management etc.
[ ] Supporting documentation, possibly detailing how best to go about testing in certain situations
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: