mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-11-16 17:09:09 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user