The best way to control Claude Code, Codex and more from any computer or phone

main
ts 24 lines 849 Bytes
Raw
1 import { describe, expect, it, vi } from "vite-plus/test";
2
3 const mocks = vi.hoisted(() => ({
4 notificationAsync: vi.fn(() => Promise.resolve()),
5 }));
6
7 vi.mock("expo-haptics", () => ({
8 NotificationFeedbackType: { Success: "success", Error: "error" },
9 notificationAsync: mocks.notificationAsync,
10 }));
11
12 vi.mock("./vcs", () => ({ vcsActionManager: {} }));
13
14 import { dismissGitActionResult, showGitActionResult } from "./use-vcs-action-state";
15
16 describe("showGitActionResult", () => {
17 it("buzzes once per reported result with the matching feedback type", () => {
18 showGitActionResult({ type: "success", title: "Pushed" });
19 showGitActionResult({ type: "error", title: "Git action failed", description: "rejected" });
20 dismissGitActionResult();
21
22 expect(mocks.notificationAsync.mock.calls).toEqual([["success"], ["error"]]);
23 });
24 });