import assert from 'node:assert/strict'; import test from 'node:test'; import { canRestoreDesktopSessionImmediately } from '../src/utils/desktopEmbedSession.js'; test('desktop SSO can restore a valid fallback user without blocking the first render', () => { assert.equal(canRestoreDesktopSessionImmediately(true, { sub: 7 }), true); }); test('regular browsers and missing users must complete normal authentication', () => { assert.equal(canRestoreDesktopSessionImmediately(false, { sub: 7 }), false); assert.equal(canRestoreDesktopSessionImmediately(true, null), false); });