Skip to content

Commit 0dcb7a9

Browse files
test(mobile): branch naming and server controls settings tests load again
Both tests from #18381 mocked components/AppText and components/ScreenScrollView, which moved to components/ui in #20043. The mocks no longer matched, so the real modules loaded: BranchNamingSettings hit the react-native mock without Text, and the server controls screen pulled in untransformed react-native Flow source. Point the mocks at the ui paths. The server controls screen also renders DatabaseStorageNotice, which loads expo modules that need __DEV__. Mock it like the other settings sections. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e2cc34f commit 0dcb7a9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.test.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ vi.mock("../../state/use-atom-command", () => ({
2525
useAtomCommand: () => mocks.updateSettings,
2626
}));
2727
vi.mock("../threads/thread-settings-options", () => ({ RUNTIME_MODE_CHOICES: [] }));
28-
vi.mock("../../components/ScreenScrollView", () => ({ ScreenScrollView: Children }));
29-
vi.mock("../../components/AppText", () => ({ AppText: Children }));
28+
vi.mock("../../components/ui/ScreenScrollView", () => ({ ScreenScrollView: Children }));
29+
vi.mock("../../components/ui/AppText", () => ({ AppText: Children }));
3030
vi.mock("./components/SettingsScreen", () => ({ SettingsScreen: Children }));
3131
vi.mock("./components/SettingsEnvironmentFilterHeader", () => ({
3232
AndroidSettingsEnvironmentFilter: () => null,
3333
SettingsEnvironmentFilterHeader: () => null,
3434
}));
35+
vi.mock("./components/DatabaseStorageNotice", () => ({ DatabaseStorageNotice: () => null }));
3536
vi.mock("./components/SettingsSection", () => ({ SettingsSection: Children }));
3637
vi.mock("./components/SettingsChoiceRow", () => ({ SettingsChoiceRow: () => null }));
3738
vi.mock("./components/SettingsSwitchRow", () => ({ SettingsSwitchRow: () => null }));

‎apps/mobile/src/features/settings/components/BranchNamingSettings.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const inputs = vi.hoisted(() => new Map<string, InputProps>());
1717
vi.mock("react-native", () => ({
1818
View: ({ children }: { children: ReactNode }) => <div>{children}</div>,
1919
}));
20-
vi.mock("../../../components/AppText", () => ({
20+
vi.mock("../../../components/ui/AppText", () => ({
2121
AppText: ({ children }: { children: ReactNode }) => <span>{children}</span>,
2222
AppTextInput: (props: InputProps) => {
2323
inputs.set(props.accessibilityLabel, props);

0 commit comments

Comments
 (0)