Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: mock useChangelog in about-dialog.test.tsx
  • Loading branch information
hearsilent committed Mar 18, 2026
commit f39f99d2f571b19e0101ccb9e9f6ca622966ea5f
10 changes: 10 additions & 0 deletions src/components/about-dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ const openerState = vi.hoisted(() => ({
openUrlMock: vi.fn(() => Promise.resolve()),
}))

const changelogState = vi.hoisted(() => ({
releases: [] as import("@/hooks/use-changelog").Release[],
loading: false,
error: null as string | null,
}))

vi.mock("@tauri-apps/plugin-opener", () => ({
openUrl: openerState.openUrlMock,
}))

vi.mock("@/hooks/use-changelog", () => ({
useChangelog: () => changelogState,
}))

describe("AboutDialog", () => {
it("renders version, links, and maintainers", () => {
render(<AboutDialog version="1.2.3" onClose={() => {}} />)
Expand Down
Loading