Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Add coverage for no-upstream default-branch quick actions

Julius Marmingef3b3c548596a
diff --git a/apps/web/src/components/GitActionsControl.logic.test.ts b/apps/web/src/components/GitActionsControl.logic.test.ts
index b31c18cec..c725da105 100644
--- a/apps/web/src/components/GitActionsControl.logic.test.ts
+++ b/apps/web/src/components/GitActionsControl.logic.test.ts
@@ -608,6 +608,63 @@ describe("when: branch has no upstream configured", () => {
},
]);
});
+
+ it("resolveQuickAction uses push-only on default branch when no upstream exists", () => {
+ const quick = resolveQuickAction(
+ status({
+ branch: "main",
+ hasUpstream: false,
+ aheadCount: 0,
+ pr: null,
+ }),
+ false,
+ true,
+ );
+ assert.deepInclude(quick, {
+ kind: "run_action",
+ action: "commit_push",
+ label: "Push",
+ disabled: false,
+ });
+ });
+
+ it("buildMenuItems still disables push and create PR when branch is behind", () => {
+ const items = buildMenuItems(
+ status({
+ hasUpstream: false,
+ behindCount: 1,
+ aheadCount: 0,
+ pr: null,
+ }),
+ false,
+ );
+ assert.deepEqual(items, [
+ {
+ id: "commit",
+ label: "Commit",
+ disabled: true,
+ icon: "commit",
+ kind: "open_dialog",
+ dialogAction: "commit",
+ },
+ {
+ id: "push",
+ label: "Push",
+ disabled: true,
+ icon: "push",
+ kind: "open_dialog",
+ dialogAction: "push",
+ },
+ {
+ id: "pr",
+ label: "Create PR",
+ disabled: true,
+ icon: "pr",
+ kind: "open_dialog",
+ dialogAction: "create_pr",
+ },
+ ]);
+ });
});
describe("requiresDefaultBranchConfirmation", () => {