app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

inbox-readback.test.ts (861B)


      1 import { test } from 'node:test';
      2 import assert from 'node:assert/strict';
      3 import {
      4   inboxReadbackSnapshot,
      5   closeInboxReadback
      6 } from '../../src/lib/nostr/inbox-readback.ts';
      7 import { verifyInboxSetupOperation } from '../../src/lib/messaging/inbox-setup-verification.ts';
      8 await test('SSR and forged readback controls grant no setup or publication authority', async () => {
      9   assert.equal(typeof window, 'undefined');
     10   assert.equal(inboxReadbackSnapshot({} as never), undefined);
     11   assert.doesNotThrow(() => closeInboxReadback({} as never));
     12   const result = await verifyInboxSetupOperation(
     13     {} as never,
     14     {} as never,
     15     undefined,
     16     {} as never,
     17     {} as never
     18   );
     19   assert.equal(result.status, 'invalid');
     20   assert.equal(result.setupComplete, false);
     21   assert.equal(result.newListingReady, false);
     22   assert.equal(result.sendReady, false);
     23 });