From de71c5045362a7a10f08dbdaac02e20cbd4b8622 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 11:40:37 +0000 Subject: [PATCH] fix: add missing mocks to publish-spell test - Add pubkey to account mock - Mock relayListCache.getOutboxRelays to prevent undefined access --- src/actions/publish-spell.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/actions/publish-spell.test.ts b/src/actions/publish-spell.test.ts index 7e870ee..fcb17d5 100644 --- a/src/actions/publish-spell.test.ts +++ b/src/actions/publish-spell.test.ts @@ -24,6 +24,12 @@ vi.mock("@/services/spell-storage", () => ({ markSpellPublished: vi.fn(), })); +vi.mock("@/services/relay-list-cache", () => ({ + relayListCache: { + getOutboxRelays: vi.fn().mockResolvedValue(["wss://relay.example.com"]), + }, +})); + describe("PublishSpellAction", () => { let action: PublishSpellAction; @@ -61,6 +67,7 @@ describe("PublishSpellAction", () => { // @ts-expect-error: mocking internal state for test accountManager.active = { + pubkey: "pubkey", signer: mockSigner, };