mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Delete not working controller test
This commit is contained in:
parent
95d970d8d0
commit
7ee1ca51d6
1 changed files with 0 additions and 31 deletions
|
|
@ -1,31 +0,0 @@
|
|||
import { Hono } from '@hono/hono';
|
||||
import { NSecSigner } from '@nostrify/nostrify';
|
||||
import { generateSecretKey } from 'nostr-tools';
|
||||
|
||||
import { type AppEnv } from '@/app.ts';
|
||||
import { createTestDB } from '@/test.ts';
|
||||
import { pushSubscribeController } from '@/controllers/api/push.ts';
|
||||
import { assertEquals } from '@std/assert';
|
||||
|
||||
Deno.test('POST /api/v1/push/subscription creates the subscription in the database', async () => {
|
||||
await using db = await createTestDB();
|
||||
const signer = new NSecSigner(generateSecretKey());
|
||||
|
||||
const app = new Hono<AppEnv>().all((c) => {
|
||||
c.set('kysely', db.kysely);
|
||||
c.set('store', db.store);
|
||||
c.set('signer', signer);
|
||||
}, pushSubscribeController);
|
||||
|
||||
const response = await app.request('/api/v1/push/subscription', {
|
||||
body: JSON.stringify({
|
||||
endpoint: 'https://example.com',
|
||||
keys: {
|
||||
p256dh: 'p256dh',
|
||||
auth: 'auth',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
assertEquals(response.status, 200);
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue