37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
|
|
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'));
|
||
|
|
});
|
||
|
|
|