Repository navigation
Add deterministic coverage for clipboard extractItems - #1472
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/c8e8e26f-0883-4b65-9528-8780066ef999
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/c8e8e26f-0883-4b65-9528-8780066ef999
Copilot
AI
changed the title
[WIP] Add unit tests for extractItems to cover all payload types
Add deterministic coverage for clipboard Mar 24, 2026
extractItems
marcuscastelo
marked this pull request as ready for review
March 24, 2026 21:47
Contributor
There was a problem hiding this comment.
Pull request overview
Adds deterministic unit tests for ClipboardPayloadExt.extractItems, which normalizes different clipboard payload shapes into a flat Item[] while regenerating IDs. This improves domain-level regression protection around clipboard extraction behavior.
Changes:
- Added focused
extractItemstests for all supported payload variants (singleItem,Meal,Recipe). - Verified regenerated IDs are produced (vs reusing source IDs) using deterministic
Math.randommocks. - Asserted extracted items preserve non-ID content and do not mutate source payload content.
This branch was successfully deployed
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.
extractItemsis responsible for normalizing clipboard payloads into items while regenerating item IDs. This adds focused domain-level coverage for the three supported payload shapes so regressions in extraction and ID regeneration are caught early.Coverage added for all payload variants
UnifiedItempayloadMealpayload with multiple itemsRecipepayload with multiple itemsID regeneration behavior verified
Math.round(Math.random() * 1000000)) with deterministic mocksTest structure
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
test.supabase.co/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development /home/REDACTED/work/macroflows/macroflows/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/entry/process.js tems(dns block)/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development /home/REDACTED/work/macroflows/macroflows/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/entry/process.js ame rgo/bin/git credential.usern/bin/sh(dns block)/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development /home/REDACTED/work/macroflows/macroflows/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/entry/process.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
extractItemsmethod lacks test coverage. This is a critical function that extracts and regenerates IDs for items from different payload types. Add tests to verify: #1354⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.