-
Notifications
You must be signed in to change notification settings - Fork 917
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
[Test] Investigate and fix " [React Intl] Could not find required intl
object" console error for unit tests
#593
Comments
This will partically solve issue #555 |
ananzh
changed the title
[Test] Fix " [React Intl] Could not find required
[Test] Investigate and fix " [React Intl] Could not find required Jul 8, 2021
intl
object" console error for unit testsintl
object" console error for unit tests
ananzh
added a commit
to ananzh/OpenSearch-Dashboards
that referenced
this issue
Jul 16, 2021
In the FunctionComponent unit tests, we see many console errors: `Could not find required intl object. <IntlProvider> needs to exist in the component ancestry. ` This is because for some unit tests, we mount the FunctionComponent (with Enzyme's mount()) , which access to the react-intl context by FormattedMessage without their <IntlProvider /> parent wrapper. This PR solves 7 out of 8 unit tests with this issue by wrapping the <IntlProvider /> either through original enzyme_helper functions or a simple wrapper wrapWithIntl. Partically Resolved: opensearch-project#593 Signed-off-by: Anan Zhuang <[email protected]>
ananzh
added a commit
to ananzh/OpenSearch-Dashboards
that referenced
this issue
Jul 16, 2021
In the FunctionComponent unit tests, we see many console errors: `Could not find required intl object. <IntlProvider> needs to exist in the component ancestry. ` This is because for some unit tests, we mount the FunctionComponent (with Enzyme's mount()) , which access to the react-intl context by FormattedMessage without their <IntlProvider /> parent wrapper. This PR solves 7 out of 8 unit tests with this issue by wrapping the <IntlProvider /> either through original enzyme_helper functions or a simple wrapper wrapWithIntl. Partically Resolved: opensearch-project#593 Signed-off-by: Anan Zhuang <[email protected]>
5 tasks
ananzh
added a commit
to ananzh/OpenSearch-Dashboards
that referenced
this issue
Jul 23, 2021
In the FunctionComponent unit tests, we see many console errors: `Could not find required intl object. <IntlProvider> needs to exist in the component ancestry. ` This is because for some unit tests, we mount the FunctionComponent (with Enzyme's mount()) , which access to the react-intl context by FormattedMessage without their <IntlProvider /> parent wrapper. This PR solves 7 out of 8 unit tests with this issue by wrapping the <IntlProvider /> either through original enzyme_helper functions or a simple wrapper wrapWithIntl. Partically Resolved: opensearch-project#593 Backport PR: opensearch-project#654 Signed-off-by: Anan Zhuang <[email protected]>
ananzh
added a commit
to ananzh/OpenSearch-Dashboards
that referenced
this issue
Jul 23, 2021
In the FunctionComponent unit tests, we see many console errors: `Could not find required intl object. <IntlProvider> needs to exist in the component ancestry. ` This is because for some unit tests, we mount the FunctionComponent (with Enzyme's mount()) , which access to the react-intl context by FormattedMessage without their <IntlProvider /> parent wrapper. This PR solves 7 out of 8 unit tests with this issue by wrapping the <IntlProvider /> either through original enzyme_helper functions or a simple wrapper wrapWithIntl. Partically Resolved: opensearch-project#593 Backport PR: opensearch-project#654 Signed-off-by: Anan Zhuang <[email protected]>
5 tasks
ananzh
added a commit
that referenced
this issue
Jul 23, 2021
In the FunctionComponent unit tests, we see many console errors: `Could not find required intl object. <IntlProvider> needs to exist in the component ancestry. ` This is because for some unit tests, we mount the FunctionComponent (with Enzyme's mount()) , which access to the react-intl context by FormattedMessage without their <IntlProvider /> parent wrapper. This PR solves 7 out of 8 unit tests with this issue by wrapping the <IntlProvider /> either through original enzyme_helper functions or a simple wrapper wrapWithIntl. Partically Resolved: #593 Backport PR: #654 Signed-off-by: Anan Zhuang <[email protected]>
Can be closed now right @ananzh ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue
Currently, we observe the following console error when run unit tests. To make a clean unit test, we want to explore the reasons for these errors/warnings and decide whether we could fix or remove them.
Here is a list of all the unit test suites which have the above issue:
To Reproduce
Run:
yarn test:jest {path to the above test}
Expected behavior
explore each problem unit test cases and investigate each question:
what causes the console error or issues?
should this unit test log this error or warning message?
if answer to the above question is no, then can we fix it?
The final output is expected to be a cleaned unit test with un-necessary error/warnings been removed.
OpenSearch Version
OpenSearch 1.0.0
Dashboards Version
Dashboards 1.0.0
The text was updated successfully, but these errors were encountered: