mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix type errors and tests
This commit is contained in:
4 files changed
+16
-8
No files matched your search
@@ -55,7 +55,6 @@ describe('Lightning Payment', () => {
|
||||
provider={mockProvider}
|
||||
onUpdate={() => {}}
|
||||
onRemove={() => {}}
|
||||
initialTab="credits"
|
||||
/>
|
||||
</TestApp>
|
||||
);
|
||||
@@ -81,7 +80,6 @@ describe('Lightning Payment', () => {
|
||||
provider={mockProvider}
|
||||
onUpdate={() => {}}
|
||||
onRemove={() => {}}
|
||||
initialTab="credits"
|
||||
/>
|
||||
</TestApp>
|
||||
);
|
||||
@@ -101,7 +99,6 @@ describe('Lightning Payment', () => {
|
||||
provider={mockProvider}
|
||||
onUpdate={() => {}}
|
||||
onRemove={() => {}}
|
||||
initialTab="credits"
|
||||
/>
|
||||
</TestApp>
|
||||
);
|
||||
|
||||
@@ -741,7 +741,6 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
|
||||
}}
|
||||
onUpdate={() => {}}
|
||||
onRemove={() => {}}
|
||||
initialTab="credits"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -285,7 +285,6 @@ function QuillyCreditsButton({ provider }: QuillyCreditsButtonProps) {
|
||||
provider={provider}
|
||||
onUpdate={() => {}}
|
||||
onRemove={() => {}}
|
||||
initialTab="credits"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -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 });
|
||||
|
||||
|
||||
Reference in new issue
Block a user