Skip to content

test: drive the profile import on the real create-project card - #321

Merged
guan4tou2 merged 3 commits into
mainfrom
test/297-profile-import-e2e
Oct 13, 2026
Merged

guan4tou2 merged 3 commits into
mainfrom
test/297-profile-import-e2e

Conversation

@guan4tou2

Copy link
Copy Markdown
Owner

Refs #297

What

The resolver has unit tests and #308 fixed the card, but nothing drove the path the operator takes: pick a file, read the summary, press Create, and be left with what the summary said. e2e/profile-import.spec.ts does that on the built app with a temp HOME.

Only the native file picker is replaced (dialog.showOpenDialog answers with a fixture path). The IPC, the file read, the React card, project.create and the config read back from disk are the shipped code.

Covered (8 tests)

  • A then B gives B, with no leftover exclusions and no "Excluded" in the summary; the project closed and reopened holds it.
  • B then A, and the same file twice, give the same project.
  • A profile that only sets warnOnViolation: false is saved as false.
  • Exclusions with no scope, and an explicitly empty list, are applied as written.
  • YAML reads the same as JSON.
  • Clearing the import gives a project with the defaults.
  • Malformed JSON, a wrong type, a file with nothing usable, and a missing path each show their own reason and leave the earlier import untouched; the surviving draft is what is created.
  • Backing out of the picker is not an error and changes nothing; a good import afterwards clears a failure message.

Checked against the original defects

  • Putting back "pass initialConfig only when a list has entries" fails the warn-off test (Expected: false, Received: true).
  • Layering the new import over the old fails the A-then-B test (summary read 範圍 1 · 排除 1).

Both were reverted; the spec is green on the clean build.

Not covered

  • The native file picker itself.
  • Anything other than Windows: it was run on Windows only, and CI runs e2e on ubuntu.

Gates

typecheck, verify:specs, verify:architecture and verify:i18n are green. npm test had one failure, test/zsh-divert-missing-pts.test.ts, a WSL-backed test this branch does not touch: it timed out at 90 s under the full-suite load and passed on its own in 20 s, the shape CLAUDE.md documents as the known flake.

🤖 Generated with Claude Code

Refs #297

The unit tests hold the resolver, and #308 fixed the card. What neither can
show is the path the operator takes: pick a file, read the summary, press
Create, and be left with exactly what the summary said, then close the project,
open it again and still have it.

e2e/profile-import.spec.ts runs the built app with a temp HOME. Only the native
file picker is replaced (dialog.showOpenDialog answers with a fixture path);
the IPC, the file read, the card, project.create and the config read back from
disk are the shipped code. It covers A then B, B then A and the same file
twice, a warning-off profile on its own, exclusions with no scope, an
explicitly empty list, YAML, clearing, each refused-file case leaving the
earlier import untouched, and backing out of the picker. A project closed and
reopened holds what was created.

Checked against the two original defects: putting back "pass the config only
when a list has entries" fails the warn-off test, and layering the new import
over the old fails the A-then-B test. Both reverted.

Not exercised: the native picker itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 545bdcc5-e7df-42be-848f-2cd5a2c38799
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

guan4tou2 and others added 2 commits October 13, 2026 16:26
Under xvfb a fresh Electron window yields no animation frames until something wakes it, and Playwright's click waits for two stable frames, so the spec timed out on its first click on ubuntu CI while passing on Windows. page.bringToFront() restores frames; reproduced and verified in WSL under xvfb-run.

Refs #297

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…oFront

bringToFront did not hold: with it the spec still timed out on its first click under xvfb. A reload restores animation frames, and is what the other specs that click after launch already do. Verified in WSL under xvfb-run.

Refs #297

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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