fix(tests): stub ResizeObserver in WorkItemDescriptionEditing suite - #730
Closed
Neonforge98 wants to merge 1 commit into
Closed
fix(tests): stub ResizeObserver in WorkItemDescriptionEditing suite#730Neonforge98 wants to merge 1 commit into
Neonforge98 wants to merge 1 commit into
Conversation
The suite added in #722 mounts WorkItemContent, whose useElementDimensions hook constructs a ResizeObserver on layout; jsdom has none, so 6 cases throw and every open PR's merge-run CI fails. Mirror the stubGlobal / unstubAllGlobals pattern already used by the sibling HistoryTab suite. Pre-commit hook ran. Total eslint: 18, total circular: 0
Collaborator
Author
|
Superseded by #729, which fixes the same CI breakage at the root: the runtime guard in useElementDimensions covers every current and future jsdom suite that mounts a consumer of this hook, while this PR only stubbed the one failing file. Verified #729's degradation path is real (the hook's unconditional window-resize fallback + initial measure) before closing. Deleting this branch. |
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.
Problem
The
WorkItemDescriptionEditing.test.tssuite added in #722 mountsWorkItemContent, whoseuseElementDimensionshook constructs aResizeObserverin a layout effect (src/hooks/ui/layout/useElementDimensions.ts:126). jsdom provides noResizeObserver, so 6 of the 16 cases throwReferenceError: ResizeObserver is not defined.Because PR checks run on the merge commit with develop, this fails the Frontend job of every open PR (first seen on #728, whose diff is unrelated).
Fix
Add the same
vi.stubGlobal("ResizeObserver", …)/vi.unstubAllGlobals()pair the siblingHistoryTab.test.tssuite already uses.Verification
npx vitest run …/WorkItemDescriptionEditing.test.ts→ 6 failed / 10 passed, identical to CI.__tests__/dir → 14 files, 66/66 passed.