view-context.test.ts (642B)
1 import test from 'node:test'; 2 import assert from 'node:assert/strict'; 3 import { 4 createIdentityViewContext, 5 mountIdentityView, 6 connectIdentityView, 7 closeIdentityView, 8 identityViewSnapshot 9 } from '../../src/lib/runtime/view-context.ts'; 10 await test('root identity view construction and explicit SSR calls acquire no browser identity', async () => { 11 assert.equal(typeof window, 'undefined'); 12 const c = createIdentityViewContext(); 13 assert.equal(mountIdentityView(c), false); 14 assert.equal((await connectIdentityView(c)).mounted, false); 15 closeIdentityView(c); 16 assert.equal(identityViewSnapshot(c).identity.state, 'guest'); 17 });