mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 07:56:50 +02:00
fix: resolve test failures and build issues
- Add mock for relay-list-cache in publish-spell.test.ts - Add pubkey property to account mock (required by PublishSpellAction) - KindRenderer changes picked up from prior linting fixes
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,
|
||||
};
|
||||
|
||||
|
||||
@@ -11,12 +11,6 @@ import {
|
||||
} from "@/lib/nostr-schema";
|
||||
import { CenteredContent } from "./ui/CenteredContent";
|
||||
import {
|
||||
REPLACEABLE_START,
|
||||
REPLACEABLE_END,
|
||||
EPHEMERAL_START,
|
||||
EPHEMERAL_END,
|
||||
PARAMETERIZED_REPLACEABLE_START,
|
||||
PARAMETERIZED_REPLACEABLE_END,
|
||||
isReplaceableKind,
|
||||
isEphemeralKind,
|
||||
isParameterizedReplaceableKind,
|
||||
@@ -86,12 +80,11 @@ export default function KindRenderer({ kind }: { kind: number }) {
|
||||
<div>{eventType}</div>
|
||||
<div className="text-muted-foreground">Storage</div>
|
||||
<div>
|
||||
{kind >= EPHEMERAL_START && kind < EPHEMERAL_END
|
||||
{isEphemeralKind(kind)
|
||||
? "Not stored (ephemeral)"
|
||||
: "Stored by relays"}
|
||||
</div>
|
||||
{kind >= PARAMETERIZED_REPLACEABLE_START &&
|
||||
kind < PARAMETERIZED_REPLACEABLE_END && (
|
||||
{isParameterizedReplaceableKind(kind) && (
|
||||
<>
|
||||
<div className="text-muted-foreground">Identifier</div>
|
||||
<code className="font-mono text-xs">d-tag</code>
|
||||
|
||||
Reference in New Issue
Block a user