mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
test: check if nip05 exists and then check again to see if it's null
This commit is contained in:
parent
dfff63fab4
commit
dd5397e795
1 changed files with 14 additions and 4 deletions
|
|
@ -85,6 +85,16 @@ Deno.test('Admin revokes nip05 grant and nip05 column gets null', async () => {
|
|||
|
||||
await store.event(event);
|
||||
|
||||
const row = await db.kysely
|
||||
.selectFrom('author_stats')
|
||||
.selectAll()
|
||||
.where('pubkey', '=', getPublicKey(alex))
|
||||
.executeTakeFirst();
|
||||
|
||||
assertEquals(row?.nip05, 'alex@gleasonator.dev');
|
||||
assertEquals(row?.nip05_domain, 'gleasonator.dev');
|
||||
assertEquals(row?.nip05_hostname, 'gleasonator.dev');
|
||||
|
||||
const adminDeletion = await conf.signer.signEvent({
|
||||
kind: 5,
|
||||
created_at: nostrNow(),
|
||||
|
|
@ -97,15 +107,15 @@ Deno.test('Admin revokes nip05 grant and nip05 column gets null', async () => {
|
|||
|
||||
await store.event(adminDeletion);
|
||||
|
||||
const row = await db.kysely
|
||||
const nullRow = await db.kysely
|
||||
.selectFrom('author_stats')
|
||||
.selectAll()
|
||||
.where('pubkey', '=', getPublicKey(alex))
|
||||
.executeTakeFirst();
|
||||
|
||||
assertEquals(row?.nip05, null);
|
||||
assertEquals(row?.nip05_domain, null);
|
||||
assertEquals(row?.nip05_hostname, null);
|
||||
assertEquals(nullRow?.nip05, null);
|
||||
assertEquals(nullRow?.nip05_domain, null);
|
||||
assertEquals(nullRow?.nip05_hostname, null);
|
||||
});
|
||||
|
||||
function setupTest(cb?: (req: Request) => Response | Promise<Response>) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue