From ec7615503769938e5e2a52237d8eea91402fde6d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Dec 2025 11:24:58 +0000 Subject: [PATCH] fix: add missing mocks in publish-spell test - Add pubkey to mocked accountManager.active - Mock relayListCache.getOutboxRelays to prevent undefined error --- src/actions/publish-spell.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/actions/publish-spell.test.ts b/src/actions/publish-spell.test.ts index 7e870ee..49a5e0c 100644 --- a/src/actions/publish-spell.test.ts +++ b/src/actions/publish-spell.test.ts @@ -10,6 +10,7 @@ vi.mock("@/services/accounts", () => ({ default: { active: { signer: {}, + pubkey: "test-pubkey", }, }, })); @@ -24,6 +25,12 @@ vi.mock("@/services/spell-storage", () => ({ markSpellPublished: vi.fn(), })); +vi.mock("@/services/relay-list-cache", () => ({ + relayListCache: { + getOutboxRelays: vi.fn().mockResolvedValue([]), + }, +})); + describe("PublishSpellAction", () => { let action: PublishSpellAction; @@ -62,6 +69,7 @@ describe("PublishSpellAction", () => { // @ts-expect-error: mocking internal state for test accountManager.active = { signer: mockSigner, + pubkey: "pubkey", }; const spell: LocalSpell = {