Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37821 - Fix RegistrationCommandsPage tests #10320

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MariaAga
Copy link
Member

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.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this partially reverts 4550a0c so should we cherry pick this to 3.11-stable & 3.12-stable?

@MariaAga
Copy link
Member Author

I wouldnt CP it as it cant positively affect the application it self, this is only for tests

@ekohl
Copy link
Member

ekohl commented Sep 13, 2024

Fair enough. This was causing you issues when you started to upgrade libraries?

@MariaAga
Copy link
Member Author

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 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants