fix(auth): unify imported sessions with account gating

This commit is contained in:
jjbrunton committed 2026-08-08 16:53:55 +01:00
1 parent 654bbda457
commit ea92a1a92b
15 files changed
+123 -49

No files matched your search

+8 -11
View File
@@ -7,22 +7,19 @@ describe('SessionBoundRuntime', () => {
const stop = vi.fn();
const runtime = new SessionBoundRuntime(start, stop);
expect(runtime.reconcile('login-required')).toBe(false);
expect(runtime.reconcile(false)).toBe(false);
expect(start).not.toHaveBeenCalled();
expect(runtime.reconcile('authenticated')).toBe(true);
expect(runtime.reconcile('authenticated')).toBe(true);
expect(runtime.reconcile(true)).toBe(true);
expect(runtime.reconcile(true)).toBe(true);
expect(start).toHaveBeenCalledOnce();
expect(runtime.reconcile('login-required')).toBe(false);
expect(runtime.reconcile(false)).toBe(false);
expect(stop).toHaveBeenCalledOnce();
});
it.each(['unknown', 'login-required', 'unreachable'] as const)(
'treats %s as waiting for an extension dump',
(state) => {
const runtime = new SessionBoundRuntime(vi.fn(), vi.fn());
expect(runtime.reconcile(state)).toBe(false);
},
);
it('treats incomplete authentication as waiting for an extension dump', () => {
const runtime = new SessionBoundRuntime(vi.fn(), vi.fn());
expect(runtime.reconcile(false)).toBe(false);
});
});