test(error-modal): add comprehensive unit tests for ErrorModal (Vitest + RTL) #130
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.
Description
Add a focused suite of unit tests for
ErrorModalcovering modal wiring, i18n rendering, external link attributes, refresh behavior, and basic a11y attributes. Tests are written with Vitest + @testing-library/react and follow the style used in recent PRs.Closes #113
What change does this PR introduce?
ErrorModalProposed approach
react-i18nextto return i18n keys as fallback text.useGlobalModalto assertsetPromptError(null)is called on close.Modalto inspect the props passed by the component.openandaria-labelledbyare correctly set.InfoIconrender.Endpointsand hastarget="_blank"+rel="noopener noreferrer".window.location.reloadis invoked from the Refresh button when the jsdom environment supports spying; otherwise the click is asserted to be safe (no throw).aria-labelledbyfor basic a11y.Checklist