Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): use loaded branch for untouched worktree base #23241

Mergedonly21mil(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/23241/headmerged by maria-rcks View on GitHub

Showing 3 changed files with 148 additions and 4 deletions.

x
0 of 3 viewed, 3 left
142 additions and 0 deletionsapps/mobile/src/features/threads/git/GitBranchesSheet.test.tsxAdded
View file
@@ -0,0 +1,142 @@
+import { act, type ReactNode } from "react";
+import { createRoot } from "react-dom/client";
+import { expect, it, vi } from "vite-plus/test";
+​
+type InputProps = {
+ accessibilityLabel: string;
+ value: string;
+ onChangeText: (value: string) => void;
+};
+type ActionProps = { label: string; disabled: boolean; onPress: () => void };
+const state = vi.hoisted(() => ({
+ refName: null as string | null,
+ branch: null as string | null,
+ inputs: new Map<string, InputProps>(),
+ actions: new Map<string, ActionProps>(),
+ worktrees: [] as Array<{ baseBranch: string; newBranch: string }>,
+}));
+​
+vi.mock("@react-navigation/native", () => ({ useNavigation: () => ({ goBack() {} }) }));
+vi.mock("react-native", () => ({
+ Platform: { OS: "android" },
+ useWindowDimensions: () => ({ height: 800 }),
+ View: ({ children }: { children: ReactNode }) => children,
+ ScrollView: ({ children }: { children: ReactNode }) => children,
+ Pressable: () => null,
+}));
+vi.mock("react-native-safe-area-context", () => ({
+ useSafeAreaInsets: () => ({ bottom: 0 }),
+}));
+vi.mock("../../../components/ui/AndroidScreenHeader", () => ({ AndroidSheetHeader: () => null }));