mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 16:37:06 +02:00
fix: add missing mocks to publish-spell test
- Add pubkey to account mock - Mock relayListCache.getOutboxRelays to prevent undefined access
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user