推进 INI 面板 shell handoff package display view-model
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
createIniPanelShellSessionHandoffCompatibilityReport,
|
||||
createIniPanelShellSessionHandoffDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackage,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageReport,
|
||||
createIniPanelShellSessionHandoffPackageSchema,
|
||||
createIniPanelShellSessionHandoffRenderState,
|
||||
@@ -83,6 +84,7 @@ const requiredShellExports = [
|
||||
"createIniPanelShellSessionHandoffCompatibilityReport",
|
||||
"createIniPanelShellSessionHandoffDisplayViewModel",
|
||||
"createIniPanelShellSessionHandoffPackage",
|
||||
"createIniPanelShellSessionHandoffPackageDisplayViewModel",
|
||||
"createIniPanelShellSessionHandoffPackageReport",
|
||||
"createIniPanelShellSessionHandoffPackageSchema",
|
||||
"createIniPanelShellSessionHandoffRenderState",
|
||||
@@ -236,6 +238,12 @@ assert.deepEqual(
|
||||
createIniPanelShellViewModel().shellSessionHandoffPackageReport,
|
||||
createIniPanelShellSessionHandoffPackageReport(createIniPanelShellViewModel().shellSessionHandoffPackage),
|
||||
);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellViewModel().shellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel(
|
||||
createIniPanelShellViewModel().shellSessionHandoffPackageReport,
|
||||
),
|
||||
);
|
||||
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellViewModel().shellSessionHandoffPackage), true);
|
||||
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
|
||||
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
|
||||
|
||||
@@ -58,6 +58,7 @@ assert.deepEqual(manifest, {
|
||||
"getShellSessionHandoffPackageSchema",
|
||||
"getShellSessionHandoffPackage",
|
||||
"getShellSessionHandoffPackageReport",
|
||||
"getShellSessionHandoffPackageDisplayViewModel",
|
||||
"isSupportedShellSessionHandoffPackage",
|
||||
"getLauncherLinks",
|
||||
"getControlPageApiMethods",
|
||||
@@ -171,6 +172,7 @@ assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
|
||||
assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/);
|
||||
assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
|
||||
assert.match(launchText, /\bgetShellSessionHandoffPackageReport\b/);
|
||||
assert.match(launchText, /\bgetShellSessionHandoffPackageDisplayViewModel\b/);
|
||||
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
|
||||
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
createIniPanelShellSessionHandoffCompatibilityReport,
|
||||
createIniPanelShellSessionHandoffDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackage,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageReport,
|
||||
createIniPanelShellSessionHandoffPackageSchema,
|
||||
createIniPanelShellSessionHandoffRenderState,
|
||||
@@ -71,6 +72,9 @@ const handoffPackage = createIniPanelShellSessionHandoffPackage({
|
||||
});
|
||||
const handoffPackageSchema = createIniPanelShellSessionHandoffPackageSchema();
|
||||
const handoffPackageReport = createIniPanelShellSessionHandoffPackageReport(handoffPackage);
|
||||
const handoffPackageDisplayViewModel = createIniPanelShellSessionHandoffPackageDisplayViewModel(
|
||||
handoffPackageReport,
|
||||
);
|
||||
|
||||
assert.deepEqual(schema, {
|
||||
apiName: "ini-panel-shell-integration",
|
||||
@@ -126,7 +130,7 @@ assert.deepEqual(readiness, {
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
launchMethods: 21,
|
||||
launchMethods: 22,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
},
|
||||
@@ -188,7 +192,7 @@ assert.deepEqual(handoffSummary, {
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
launchMethods: 21,
|
||||
launchMethods: 22,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
},
|
||||
@@ -544,6 +548,13 @@ assert.deepEqual(handoffPackageReport, {
|
||||
},
|
||||
],
|
||||
});
|
||||
assert.deepEqual(handoffPackageDisplayViewModel, {
|
||||
phase: "ready",
|
||||
title: "Shell handoff package",
|
||||
statusText: "Ready",
|
||||
detailText: "No blocking reasons",
|
||||
rows: handoffPackageReport.rows,
|
||||
});
|
||||
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(handoffPackage), true);
|
||||
assert.equal(
|
||||
isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, packageVersion: 2 }),
|
||||
@@ -574,6 +585,22 @@ assert.deepEqual(
|
||||
createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }).mismatchFields,
|
||||
["packageVersion"],
|
||||
);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel(
|
||||
createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }),
|
||||
).rows.find((row) => row.id === "mismatch-fields"),
|
||||
{
|
||||
id: "mismatch-fields",
|
||||
label: "Mismatched fields",
|
||||
value: "packageVersion",
|
||||
},
|
||||
);
|
||||
assert.equal(
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel(
|
||||
createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }),
|
||||
).statusText,
|
||||
"Blocked",
|
||||
);
|
||||
assert.deepEqual(
|
||||
createIniPanelShellSessionHandoffPackageReport(missingManifestField).missingManifestFields,
|
||||
["controlPageMethods"],
|
||||
@@ -805,7 +832,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
launchMethods: 21,
|
||||
launchMethods: 22,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
},
|
||||
@@ -970,6 +997,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChec
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageDisplayViewModel\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageReport\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
|
||||
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
|
||||
@@ -990,6 +1018,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageDisplayViewModel\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageReport\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);
|
||||
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
createIniPanelShellSessionHandoffCompatibilityReport,
|
||||
createIniPanelShellSessionHandoffDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackage,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageReport,
|
||||
createIniPanelShellSessionHandoffPackageSchema,
|
||||
createIniPanelShellSessionHandoffRenderState,
|
||||
@@ -84,6 +85,7 @@ assert.equal(typeof createIniPanelShellSessionHandoffChecklist, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffPackage, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffPackageDisplayViewModel, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffPackageReport, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffPackageSchema, "function");
|
||||
assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function");
|
||||
@@ -210,6 +212,10 @@ assert.deepEqual(
|
||||
shellViewModel.shellSessionHandoffPackageReport,
|
||||
createIniPanelShellSessionHandoffPackageReport(shellViewModel.shellSessionHandoffPackage),
|
||||
);
|
||||
assert.deepEqual(
|
||||
shellViewModel.shellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel(shellViewModel.shellSessionHandoffPackageReport),
|
||||
);
|
||||
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(shellViewModel.shellSessionHandoffPackage), true);
|
||||
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
|
||||
phase: "ready",
|
||||
@@ -429,6 +435,13 @@ assert.deepEqual(shellViewModel.shellSessionHandoffPackageReport, {
|
||||
},
|
||||
],
|
||||
});
|
||||
assert.deepEqual(shellViewModel.shellSessionHandoffPackageDisplayViewModel, {
|
||||
phase: "ready",
|
||||
title: "Shell handoff package",
|
||||
statusText: "Ready",
|
||||
detailText: "No blocking reasons",
|
||||
rows: shellViewModel.shellSessionHandoffPackageReport.rows,
|
||||
});
|
||||
assert.equal(
|
||||
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
|
||||
true,
|
||||
@@ -477,6 +490,10 @@ assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanel
|
||||
assert.equal(shellViewModel.createShellSessionHandoffActionPlan, createIniPanelShellSessionHandoffActionPlan);
|
||||
assert.equal(shellViewModel.createShellSessionHandoffChecklist, createIniPanelShellSessionHandoffChecklist);
|
||||
assert.equal(shellViewModel.createShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackage);
|
||||
assert.equal(
|
||||
shellViewModel.createShellSessionHandoffPackageDisplayViewModel,
|
||||
createIniPanelShellSessionHandoffPackageDisplayViewModel,
|
||||
);
|
||||
assert.equal(shellViewModel.createShellSessionHandoffPackageReport, createIniPanelShellSessionHandoffPackageReport);
|
||||
assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema);
|
||||
assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage);
|
||||
|
||||
Reference in New Issue
Block a user