Fixes #37821 - Fix RegistrationCommandsPage tests
export const mock = () => new MockAdapter(axios); was moved to be a function because it caused webpack issues, but we exclude this file from ExportAll. There should only be one MockAdapter.
one of the issues of having multiple instances of the mockAdapter is this error:
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
^
Error: When called with an action of type "REGISTRATION_COMMANDS_FAILURE", the slice reducer for key "reducerSpy" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.
webpack/assets/javascripts/react_app/redux/actions/common/forms.test.js didnt use mocks anymore so it doesnt need to reset them.
I wouldnt CP it as it cant positively affect the application it self, this is only for tests
Fair enough. This was causing you issues when you started to upgrade libraries?
Fair enough. This was causing you issues when you started to upgrade libraries?
This was more noticeable when other tests were failing and I was looking into errors in tests, also had it fail once when running but not another time :shrug:
Need to also fix integration test for this page
does it make sense to squash them? they're doing pretty different things
@ofedoren could you please merge it?