test(dashboard): type the onSave mock so mock.calls indexing typechecks

vi.fn(async () => {}) infers a zero-arg mock, so mock.calls[0][0] is a
TS2493 tuple-out-of-range error that check:dashboard-typecheck flags as a
new regression (3 sites). Give the mock the modal's real onSave signature.
This commit is contained in:
diegosouzapw
2026-11-09 09:42:19 -03:00
parent a9c12729f4
commit 9edc7e4a11

View File

@@ -81,7 +81,7 @@ describe("EditCompatibleNodeModal (Phase 1b extraction)", () => {
}
it("Quota check toggle submits the standard /credits path when switched on", async () => {
const onSave = vi.fn(async () => {});
const onSave = vi.fn<(data: unknown) => Promise<void>>(async () => {});
const c = renderModal(
<EditCompatibleNodeModal
isOpen
@@ -108,7 +108,7 @@ describe("EditCompatibleNodeModal (Phase 1b extraction)", () => {
});
it("Quota check reflects the connections' state and can be switched off", async () => {
const onSave = vi.fn(async () => {});
const onSave = vi.fn<(data: unknown) => Promise<void>>(async () => {});
const c = renderModal(
<EditCompatibleNodeModal
isOpen