The previous test file was not actually testing - it was just example code
showing how to use the Link component. This commit replaces it with proper
Vitest 4.0.6 compatible tests using @testing-library/react.
Changes:
- Install jsdom, happy-dom, @testing-library/jest-dom, and @testing-library/user-event
- Update vitest.config.ts to use jsdom environment instead of node
- Add vitest.setup.ts to configure jest-dom matchers globally
- Replace renderToStaticMarkup approach with proper render() from @testing-library/react
- Add 7 comprehensive tests covering:
- Internal routing with href prop
- Internal routing with to prop
- External links with default target="_blank" and rel="noopener noreferrer"
- Overriding target and rel attributes
- href prioritization over to prop
- Custom className application
- onClick event handling with userEvent
All tests pass without warnings.
Description
Related Issue
same as dependabot #816
Motivation and Context
dependabot
How Has This Been Tested?
Locally
Screenshots (if appropriate):