Add React Testing Library framework for frontend component testing#9020
Closed
Add React Testing Library framework for frontend component testing#9020
Conversation
1 task
Agent-Logs-Url: https://github.com/invoke-ai/InvokeAI/sessions/b5cf4193-5380-44b0-aeeb-763044498cdb Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
…omponent tests Agent-Logs-Url: https://github.com/invoke-ai/InvokeAI/sessions/b5cf4193-5380-44b0-aeeb-763044498cdb Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add testing framework for frontend using React Testing Library
Add React Testing Library framework for frontend component testing
Apr 5, 2026
Collaborator
|
Still thinking about this... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Establishes a component testing framework for the frontend using React Testing Library + Vitest/jsdom. Previously, tests covered only pure logic (utilities, reducers, graph construction) — no DOM or component-level tests were possible.
Infrastructure
@testing-library/react,@testing-library/user-event,@testing-library/jest-dom,jsdomas dev depsenvironment: 'jsdom'and a global setup file invite.config.mtssrc/tests/setup.tsexpectwith jest-dom DOM matchers (toBeInTheDocument,toHaveAttribute, etc.)afterEach(cleanup)to prevent DOM leaking between testssrc/tests/test-utils.tsx— reusable render wrapperAccepts an optional
storeparameter for tests that need pre-seeded Redux state.Example tests
WavyLine.test.tsx— pure component, usesrenderdirectly; demonstrates SVG attribute assertionsIAIImageFallback.test.tsx— Chakra UI component, usesrenderWithProviders; demonstrates label/icon conditional rendering testsRelated Issues / Discussions
Closes #5440
QA Instructions
New test files can be verified individually:
Merge Plan
No special merge considerations.
Checklist
What's Newcopy (if doing a release after this PR)