UserStore.test: use MockRelay

This commit is contained in:
Alex Gleason 2024-04-26 15:39:28 -05:00
parent 7e053fbeea
commit 606ab58c0a
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 6 additions and 4 deletions

View File

@ -1,10 +1,12 @@
import { MockRelay } from '@nostrify/nostrify/test';
import { assertEquals } from '@/deps-test.ts';
import { UserStore } from '@/storages/UserStore.ts';
import userBlack from '~/fixtures/events/kind-0-black.json' with { type: 'json' };
import userMe from '~/fixtures/events/event-0-makes-repost-with-quote-repost.json' with { type: 'json' };
import blockEvent from '~/fixtures/events/kind-10000-black-blocks-user-me.json' with { type: 'json' };
import event1authorUserMe from '~/fixtures/events/event-1-quote-repost-will-be-reposted.json' with { type: 'json' };
import { NCache } from 'jsr:@nostrify/nostrify';
import { UserStore } from '@/storages/UserStore.ts';
import { assertEquals } from '@/deps-test.ts';
Deno.test('query events of users that are not blocked', async () => {
const userBlackCopy = structuredClone(userBlack);
@ -12,7 +14,7 @@ Deno.test('query events of users that are not blocked', async () => {
const blockEventCopy = structuredClone(blockEvent);
const event1authorUserMeCopy = structuredClone(event1authorUserMe);
const db = new NCache({ max: 100 });
const db = new MockRelay();
const store = new UserStore(userBlackCopy.pubkey, db);