Skip to content

test: cover both insertion paths on a folder QuickAdd cannot read - #1586

Merged
chhoumann merged 1 commit into
masterfrom
chhoumann/1566-followup-insertion-cta-test
Jul 27, 2026
Merged

test: cover both insertion paths on a folder QuickAdd cannot read#1586
chhoumann merged 1 commit into
masterfrom
chhoumann/1566-followup-insertion-cta-test

Conversation

@chhoumann

@chhoumann chhoumann commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Test-only follow-up to #1583, from a CodeRabbit thread that landed just as it merged. Closes nothing.

The gap

A folder whose choices value could still be holding choices offers neither of the two controls that would write to that value, because either write would discard it. The regression test in #1583 asserted only one of them:

expect(queryByLabelText("Add a choice to Broken"), shape.key).toBeNull();

"Add folder" (AddChoiceControls renders both) writes to the same array, through the same insertIntoMulti path. So the second destructive insertion path was live behaviour with no test behind it — a regression that restored just that button would have shipped green.

The change

One extra assertion, plus a comment saying why both belong together.

Validation

Confirmed it guards something rather than just reading like it does: forcing MultiChoiceListItem's unreadable branch off ({#if unreadable}{#if false}) makes the test fail, restoring it makes it pass. Full suite green (4305 passed), tsc, svelte-check and eslint clean.

No source change, so no behaviour change and nothing to verify in a vault.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented “Add a choice” and “Add a folder” actions from appearing for malformed folders when they could overwrite existing data.

Per review: "Add folder" writes to the same children value as "Add
choice", so asserting only one left the other destructive path
unguarded by the test.

Refs #1566
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9aa9364
Status: ✅  Deploy successful!
Preview URL: https://3523e3a7.quickadd.pages.dev
Branch Preview URL: https://chhoumann-1566-followup-inse.quickadd.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f78c46bc-581f-448d-833b-1e2aa4a5d9a2

📥 Commits

Reviewing files that changed from the base of the PR and between 234a349 and 9aa9364.

📒 Files selected for processing (1)
  • src/gui/choiceList/ChoiceView.malformed.test.ts

📝 Walkthrough

Walkthrough

The malformed-folder test now verifies that both “Add a choice to Broken” and “Add a folder to Broken” call-to-actions are absent.

Changes

Malformed tree validation

Layer / File(s) Summary
Insertion CTA absence assertions
src/gui/choiceList/ChoiceView.malformed.test.ts
The lossy malformed-folder test checks that both choice and folder insertion call-to-actions are absent.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A rabbit checks the broken tree,
No choice or folder CTA can flee.
Two guarded paths now both stay still,
Safe beneath the malformed hill.
Hop, hop—tests guard the sill!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the test update covering both insertion paths on an unreadable folder.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chhoumann/1566-followup-insertion-cta-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chhoumann
chhoumann merged commit d6b1fdf into master Jul 27, 2026
13 checks passed
@chhoumann
chhoumann deleted the chhoumann/1566-followup-insertion-cta-test branch July 27, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant