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

I am facing issue with elastic UI version 80.0.0 when I am trying to create a test case. emotion/css version - 11.11.2 emotion/react version – 11.11.3 emotion/styled version – 11.11.0 emotion/datemath version – 5.0.3 #7471

Closed
lokendrak2 opened this issue Jan 22, 2024 · 6 comments
Labels

Comments

@lokendrak2
Copy link

● Test suite failed to run

TypeError: Cannot set properties of undefined (setting 'diff')

> 1 | import { EuiLink, EuiPanel, EuiText } from "@elastic/eui";
    | ^
  2 |
  3 | const VerifyYourEmailMessage = () => {
  4 |   return (

  at Object.<anonymous> (node_modules/text-diff/diff.js:1393:13)
  at Object.<anonymous> (node_modules/@elastic/eui/lib/components/text_diff/text_diff.js:9:40)
  at Object.<anonymous> (node_modules/@elastic/eui/lib/components/text_diff/index.js:12:18)
  at Object.<anonymous> (node_modules/@elastic/eui/lib/components/index.js:875:18)
  at Object.<anonymous> (node_modules/@elastic/eui/lib/index.js:6:19)
  at Object.<anonymous> (src/components/VerifyYourEmailMessage.tsx:1:1)
  at Object.<anonymous> (src/App.tsx:4:1)
  at Object.<anonymous> (src/App.test.tsx:3:1)
@tkajtoch
Copy link
Member

Hi @lokendrak2! Is upgrading to the latest @elastic/eui v92.1.1 an option?

Could you share more information about what testing framework you're using and how is it set up?

@lokendrak2
Copy link
Author

@tkajtoch I have using with this version "jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
and created a jest config ts
I was trying to upgrade but facing some tags issue and I am using JEST for testing framework.

@tkajtoch
Copy link
Member

Could you provide steps to reproduce and a simple test case file that fails to run/compile? That way we can run it locally and see if you need a general or application-specific fix

@lokendrak2
Copy link
Author

Hi, We are not able to write a single test case. We have tried to upgrade the elastic UI but facing issue in application.
so we had continued with version 80.0.0.
Except upgrading the version of elastic UI, is there any other solution to fix this issue or we have to upgrade it.
if Version upgrade is the only solution then we have to manage all the component related issue.

this is the old application and now we have start working on test case.

@lokendrak2
Copy link
Author

we are using Jest for testing. please suggest can we use any other framework for testing.

@tkajtoch
Copy link
Member

tkajtoch commented Jan 29, 2024

Unfortunately, this is a pretty old version, and we no longer support it. My suggestion would be to try upgrading to the latest @elastic/eui and check if that helps.

It seems like this error comes from this pointing to undefined instead of window. Are you sure you're actually running jest with jsdom test environment?

@JasonStoltz JasonStoltz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants