From 6839f50a48b49f03017c7657ba4aa5667242b701 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 31 Dec 2025 10:25:27 -0600 Subject: [PATCH] Fix type errors and tests --- src/components/LightningPayment.test.tsx | 3 --- src/components/OnboardingDialog.tsx | 1 - src/components/Quilly.tsx | 1 - src/lib/commands/git/log.test.ts | 19 ++++++++++++++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/LightningPayment.test.tsx b/src/components/LightningPayment.test.tsx index d0e66b34..e9326a99 100644 --- a/src/components/LightningPayment.test.tsx +++ b/src/components/LightningPayment.test.tsx @@ -55,7 +55,6 @@ describe('Lightning Payment', () => { provider={mockProvider} onUpdate={() => {}} onRemove={() => {}} - initialTab="credits" /> ); @@ -81,7 +80,6 @@ describe('Lightning Payment', () => { provider={mockProvider} onUpdate={() => {}} onRemove={() => {}} - initialTab="credits" /> ); @@ -101,7 +99,6 @@ describe('Lightning Payment', () => { provider={mockProvider} onUpdate={() => {}} onRemove={() => {}} - initialTab="credits" /> ); diff --git a/src/components/OnboardingDialog.tsx b/src/components/OnboardingDialog.tsx index 85d9c228..a83175d5 100644 --- a/src/components/OnboardingDialog.tsx +++ b/src/components/OnboardingDialog.tsx @@ -741,7 +741,6 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps) }} onUpdate={() => {}} onRemove={() => {}} - initialTab="credits" /> )} diff --git a/src/components/Quilly.tsx b/src/components/Quilly.tsx index 960349c5..cad55379 100644 --- a/src/components/Quilly.tsx +++ b/src/components/Quilly.tsx @@ -285,7 +285,6 @@ function QuillyCreditsButton({ provider }: QuillyCreditsButtonProps) { provider={provider} onUpdate={() => {}} onRemove={() => {}} - initialTab="credits" /> ); diff --git a/src/lib/commands/git/log.test.ts b/src/lib/commands/git/log.test.ts index 54e9124a..8ae74be1 100644 --- a/src/lib/commands/git/log.test.ts +++ b/src/lib/commands/git/log.test.ts @@ -1,8 +1,21 @@ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import { MockFS } from '@/test/MockFS'; import { Git } from '@/lib/git'; import { GitLogCommand } from './log'; -import { NPool } from '@nostrify/nostrify'; +import type { NPool, NostrEvent } from '@nostrify/nostrify'; + +const createMockNostr = (): NPool => { + const events: NostrEvent[] = []; + return { + req: vi.fn(), + query: vi.fn(async () => events), + event: vi.fn(async (event: NostrEvent) => { events.push(event); }), + group: vi.fn().mockReturnValue({ query: vi.fn(async () => events) }), + relay: vi.fn(), + relays: new Map(), + close: vi.fn(), + } as unknown as NPool; +}; describe('GitLogCommand', () => { let fs: MockFS; @@ -13,7 +26,7 @@ describe('GitLogCommand', () => { fs = new MockFS(); git = new Git({ fs, - nostr: new NPool(), + nostr: createMockNostr(), }); logCommand = new GitLogCommand({ git, fs });