The best way to control Claude Code, Codex and more from any computer or phone
Add coverage for no-upstream default-branch quick actions
- test push-only quick action on default branch without upstream - verify push and create PR stay disabled when branch is behind
Julius Marminge committed
Mar 1, 2026 at 11:00 UTC
f3b3c548596af0a70fb8eddcc49118e5a5e154b2
1 file changed
+57
apps/web/src/components/GitActionsControl.logic.test.ts
+57
@@ -608,6 +608,63 @@ describe("when: branch has no upstream configured", () => {
608
},
609
]);
610
});
611
+
612
+ it("resolveQuickAction uses push-only on default branch when no upstream exists", () => {
613
+ const quick = resolveQuickAction(
614
+ status({
615
+ branch: "main",
616
+ hasUpstream: false,
617
+ aheadCount: 0,
618
+ pr: null,
619
+ }),
620
+ false,
621
+ true,
622
+ );
623
+ assert.deepInclude(quick, {
624
+ kind: "run_action",
625
+ action: "commit_push",
626
+ label: "Push",
627
+ disabled: false,
628
+ });
629
+ });
630
+
631
+ it("buildMenuItems still disables push and create PR when branch is behind", () => {
632
+ const items = buildMenuItems(
633
+ status({
634
+ hasUpstream: false,
635
+ behindCount: 1,
636
+ aheadCount: 0,
637
+ pr: null,
638
+ }),
639
+ false,
640
+ );
641
+ assert.deepEqual(items, [
642
+ {
643
+ id: "commit",
644
+ label: "Commit",
645
+ disabled: true,
646
+ icon: "commit",
647
+ kind: "open_dialog",
648
+ dialogAction: "commit",
649
+ },
650
+ {
651
+ id: "push",
652
+ label: "Push",
653
+ disabled: true,
654
+ icon: "push",
655
+ kind: "open_dialog",
656
+ dialogAction: "push",
657
+ },
658
+ {
659
+ id: "pr",
660
+ label: "Create PR",
661
+ disabled: true,
662
+ icon: "pr",
663
+ kind: "open_dialog",
664
+ dialogAction: "create_pr",
665
+ },
666
+ ]);
667
+ });
668
});
669
670
describe("requiresDefaultBranchConfirmation", () => {