import { cleanup, fireEvent, render, screen } from "@solidjs/testing-library"; import { GmailComposeBox } from "@/components/messages/gmail-compose-box"; import { PreferencesProvider } from "@/stores/preferences-context"; vi.mock("@/stores/auth-context", () => ({ useAuth: () => ({ user: () => ({ id: "user-1", username: "teacher", role: "teacher" }) }), })); vi.mock("@/api/messages", () => ({ postMessage: vi.fn() })); // The real picker searches the API; a plain button stands in for choosing someone. vi.mock("@/components/users/user-search-select", () => ({ UserSearchSelect: (props: { onChange: (id: string) => void }) => ( ), })); vi.mock("@/components/ui/rich-text-editor", () => ({ RichTextEditor: () =>
})); afterEach(cleanup); test("send stays disabled until there is a recipient and a subject, and says what is missing", () => { render(() => (