Repository navigation
fix(test): give the image-insert store fakes an open-files list - #25357
Merged
Merged
Conversation
#25176 and #24489 landed together and collided in insertRichMarkdownImageFromPath. #25176 added three test files whose @/store mock returns { settings, folderWorkspaces, worktreesByRepo }. #24489 made the same function look up the open document with state.openFiles.find(...) to pass document-folder access to the import. Under the mock, openFiles is undefined, so the lookup throws, the catch shows "Failed to insert image", and no image is inserted -- 38 tests fail on main. The real store always carries openFiles, so production behavior of both PRs is intact; the mocks were just written against the pre-#24489 shape. Add openFiles: [] to the three mocks.
9 tasks done
7 of 8 tasks
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.
ELI5
Main's editor tests are red (38 failures). #24489 made image insert look up the open file to decide document-folder access; #25176's new tests fake the app store without an open-files list, so that lookup throws inside the tests and nothing gets inserted. This adds the missing empty list to the three test fakes.
What Changed
Test-only:
openFiles: []added to the store fakes inrich-markdown-async-image-paste.test.ts,rich-markdown-async-image-table.test.tsanduseLocalImagePick.test.tsx. No product code changes; the real store always hasopenFiles.Why
The two PRs merged cleanly in source but their tests collided, so every open PR's CI fails on these editor tests.
Linked Issue
Maintainer PR; fixes main's red editor tests after #24489 and #25176.
Visual Proof
N/A: test-only change.
Testing
src/renderer/src/components/editor: 307 files / 2298 tests pass (38 failures on main before).pnpm run typecheck, oxlint andcheck:code-quality:changedpass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)