bigcommerce / b2b-buyer-portal

B2B Buyer Portal - BigCommerce B2B Edition
MIT License
26 stars 24 forks source link

refactor: change the way in which we create reducers and the store #51

Closed icatalina closed 4 months ago

icatalina commented 4 months ago

What/Why?

Use the recommended approach in redux.js.org to setup the store and reducers.

It is better to have all the reducers preloaded and just pass an initial state to the render method.

Added some utils and improved some of the tests/code.

I've also remove the snapshot test as it is quite unstable. It uses useId internally which might change between re-renders. Snapshot testing provides little value anyway.

Rollout/Rollback

This PR is mostly focused around tests, but if something were to fail we can simply revert it.

Testing

TS + Unit tests should prove everything is still working