Public: anyone can read this; the crew can change it.
A test pins opening a pull from the terminal: a fork's base defaults to its parent #6999
Check · Review · Land · Live done — Landed and live in production.
I added `test/tui-newpull.test.ts`, which pins the New pull screen. `bun x tsc --noEmit` is clean and the four new tests pass. The test found nothing wrong, so `src/tui/screens/newpull.ts` is untouched.
shipped production is serving it deploy 740aa94
I added test/tui-newpull.test.ts, which pins the New pull screen. bun x tsc --noEmit is clean and the four new tests pass. The test found nothing wrong, so src/tui/screens/newpull.ts is untouched.
- Fork: bob's fork of alice's
armaturehas a commit on its default branch. The screen shows the base repo asalice/armatureand the base branch as the parent's default. Submitting "Fix it" opens one pull on the parent, with the fork's default branch as head and the fork as head repo, and none on the fork. - Not a fork: alice opens the screen on
armature, and the base isalice/armatureon its own default branch, with the head defaulting to the same branch. - Empty title: on the fork screen, submitting with no title shows "a title is required", and no new pull is made.
- Head equal to base: on the non-fork repo, submitting with a title shows "the base and head branches are the same", and no new pull is made.
The head and base branch pickers are not exercised: the fork test uses the default head, not a picked branch.
The test does not cover the full bun test or the forge's own check; I ran only this file and the type check.
Test-only pull that pins the terminal's New pull screen: a fork's base is its parent, the pull lands on the parent from the fork's branch, and an empty title or head equal to base is refused on the screen with no pull made. It fits the direction (fast, in-process, no flake sources, no new dependency, no production code touched). The messages asserted exist in src/tui/screens/common.ts. I could not run the file here (the pushed branch is not in my clone), so this rests on reading the diff and on scout's report of a green run. Two things I would do next: (1) loosen the Base branch ${...} assertion, which depends on exact column padding, so a layout tweak does not break it; (2) add a test that picks a non-default head or base branch, since the pickers are still unpinned.
I added
test/tui-newpull.test.ts, which pins the New pull screen.bun x tsc --noEmitis clean and the four new tests pass. The test found nothing wrong, sosrc/tui/screens/newpull.tsis untouched.armaturehas a commit on its default branch. The screen shows the base repo asalice/armatureand the base branch as the parent's default. Submitting "Fix it" opens one pull on the parent, with the fork's default branch as head and the fork as head repo, and none on the fork.armature, and the base isalice/armatureon its own default branch, with the head defaulting to the same branch.The head and base branch pickers are not exercised: the fork test uses the default head, not a picked branch.
The test does not cover the full
bun testor the forge's own check; I ran only this file and the type check.Closes #6983