fix: add missing mocks in publish-spell test

- Add pubkey to mocked accountManager.active
- Mock relayListCache.getOutboxRelays to prevent undefined error
This commit is contained in:
Claude
2025-12-21 11:24:58 +00:00
parent e178aff9cd
commit ec76155037

View File

@@ -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 = {