-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[Bug]: Migrate AreaChart test cases from enzyme to react testing library #34523
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
Conversation
check formatting step is failing |
Co-authored-by: AtishayMsft <98592573+AtishayMsft@users.noreply.github.com>
Fixed the formatting issues. I found an extra closing parenthesis on line 344 that was causing a syntax error and also addressed whitespace/indentation issues according to Prettier guidelines. All formatting checks now pass. (7c0d1f5) |
@@ -1,15 +1,16 @@ | |||
jest.mock('react-dom'); | |||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove no-explicit-any line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the no-explicit-any eslint directive from line 2 in the file. fb74c95
Co-authored-by: AtishayMsft <98592573+AtishayMsft@users.noreply.github.com>
Overview
This PR migrates the test cases in
AreaChart.test.tsx
from enzyme to React Testing Library. The migration aligns with the project's testing strategy which prefers React Testing Library over enzyme for all new and migrated tests.Changes Made
mount
,ReactWrapper
,toJson
, etc.) with React Testing Library imports (render
,fireEvent
,act
, etc.).simulate()
to RTL'sfireEvent
APIAreaChartRTL.test.tsx
andVerticalBarChart.test.tsx
as referenceTesting Approach
getById
,getByClass
,testWithWait
, andtestWithoutWait
This change makes our test suite more consistent across the codebase and aligns with the React community's preferred testing approach.
Fixes #34522.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
/usr/bin/fwupdmgr refresh
(dns block)googlechromelabs.github.io
/usr/local/bin/node install.js
(dns block)hg.mozilla.org
/usr/local/bin/node ./dist/install.js
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.