fix(k1): restore canonical local connection lifecycle
This commit is contained in:
@@ -167,12 +167,6 @@ test("K1 Bridge adoption remains one explicit read-only plugin action", () => {
|
||||
join(pluginFrontendRoot, "components/K1ProvisioningPipeline.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
const selectionEffectStart = provisioning.indexOf("useEffect(() => {");
|
||||
const selectionEffectEnd = provisioning.indexOf(
|
||||
"useEffect(() => {",
|
||||
selectionEffectStart + 1,
|
||||
);
|
||||
const selectionEffect = provisioning.slice(selectionEffectStart, selectionEffectEnd);
|
||||
assert.match(provisioning, /connectionMode === "bridge"/);
|
||||
assert.match(provisioning, /Подхватить существующее подключение/);
|
||||
assert.match(provisioning, /pendingAction === "verify"/);
|
||||
@@ -181,9 +175,23 @@ test("K1 Bridge adoption remains one explicit read-only plugin action", () => {
|
||||
/compatibility_attestation: profileSelectionForConnectionMode\("bridge"\)/,
|
||||
);
|
||||
assert.match(provisioning, /без изменения настроек Wi‑Fi/);
|
||||
assert.match(provisioning, /deviceSummary !== undefined/);
|
||||
assert.match(selectionEffect, /!state\.devices\.some/);
|
||||
assert.match(selectionEffect, /setSelectedDeviceId\(""\)/);
|
||||
assert.match(provisioning, /deviceSummary !== null/);
|
||||
assert.match(provisioning, /device_id: deviceSummary\.device_id/);
|
||||
});
|
||||
|
||||
test("K1 provisioning keeps the operator draft separate from the backend lease", () => {
|
||||
const provisioning = readFileSync(
|
||||
join(pluginFrontendRoot, "components/K1ProvisioningPipeline.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
assert.doesNotMatch(provisioning, /setSelectedDeviceId\(state\.selected_device_id\)/);
|
||||
assert.doesNotMatch(provisioning, /setConnectionMode\(state\.connection_mode\)/);
|
||||
assert.match(provisioning, /canSubmitProvisioningMutation\(\{/);
|
||||
assert.match(provisioning, /isReachableConnectionLease\(state, connectionMode\)/);
|
||||
assert.doesNotMatch(provisioning, /else if \(connectionMode === "quick-connect"\)/);
|
||||
assert.match(provisioning, /const succeeded = await verifyConnection\(\{/);
|
||||
assert.match(provisioning, /if \(succeeded\) \{\s*provisioningIntentRef\.current = null;/);
|
||||
});
|
||||
|
||||
test("generic Control Station has one composition import and no K1 implementation knowledge", () => {
|
||||
|
||||
Reference in New Issue
Block a user