Separate domain access from code-channel login
This commit is contained in:
parent
066f14d007
commit
6b1bb203df
7 changed files with 324 additions and 6 deletions
|
|
@ -0,0 +1,37 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { projectDomainConnectionSteps } from './domain-connection.js';
|
||||
|
||||
test('code-channel account absence cannot be projected as a domain runtime login', () => {
|
||||
const steps = projectDomainConnectionSteps({
|
||||
blockers: [
|
||||
'account_node_identity_missing',
|
||||
'verified_domain_manifest_missing',
|
||||
'scoped_session_capability_missing',
|
||||
'matching_connection_receipt_missing',
|
||||
],
|
||||
runtimeReady: false,
|
||||
stage: 'login-required',
|
||||
});
|
||||
assert.deepEqual(steps.map(step => step.state), ['blocked', 'blocked', 'blocked', 'blocked']);
|
||||
assert.match(steps[0].detail, /登记的本地终端节点或云常驻节点/);
|
||||
});
|
||||
|
||||
test('verified account and node remain identity-only without domain handoff evidence', () => {
|
||||
const steps = projectDomainConnectionSteps({
|
||||
blockers: [
|
||||
'verified_domain_manifest_missing',
|
||||
'scoped_session_capability_missing',
|
||||
'matching_connection_receipt_missing',
|
||||
],
|
||||
runtimeReady: false,
|
||||
stage: 'identity-verified',
|
||||
});
|
||||
assert.deepEqual(steps.map(step => step.state), ['verified', 'blocked', 'blocked', 'blocked']);
|
||||
});
|
||||
|
||||
test('runtime-ready requires all four verified steps', () => {
|
||||
const steps = projectDomainConnectionSteps({ blockers: [], runtimeReady: true, stage: 'runtime-ready' });
|
||||
assert.ok(steps.every(step => step.state === 'verified'));
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue