mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(qa): keep Control UI parity fixture typed (#120090)
This commit is contained in:
@@ -3,7 +3,7 @@ import { createQaBusState } from "./bus-state.js";
|
||||
import type { QaLabServerHandle } from "./lab-server.types.js";
|
||||
import { runQaFlowSuiteFromRuntime } from "./suite-run.runtime.js";
|
||||
import { makeQaSuiteTestScenario } from "./suite-test-helpers.js";
|
||||
import type { QaSuiteResolvedRunContext, QaSuiteRunParams } from "./suite-types.js";
|
||||
import type { QaSuiteResolvedRunContext, QaSuiteResult, QaSuiteRunParams } from "./suite-types.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
readQaBootstrapScenarioCatalog: vi.fn(),
|
||||
@@ -54,13 +54,21 @@ beforeEach(() => {
|
||||
],
|
||||
});
|
||||
mocks.runQaFlowSuiteStandard.mockImplementation(
|
||||
async (params: QaSuiteRunParams | undefined, context: QaSuiteResolvedRunContext) => ({
|
||||
async (
|
||||
params: QaSuiteRunParams | undefined,
|
||||
context: QaSuiteResolvedRunContext,
|
||||
): Promise<QaSuiteResult> => ({
|
||||
outputDir: context.outputDir,
|
||||
evidencePath: "/qa-output/qa-evidence.json",
|
||||
reportPath: "/qa-output/qa-suite-report.md",
|
||||
summaryPath: "/qa-output/qa-suite-summary.json",
|
||||
report: "",
|
||||
scenarios: [{ name: context.selectedScenarios[0]?.title, status: "pass", steps: [] }],
|
||||
scenarios: context.selectedScenarios.map((scenario) => ({
|
||||
name: scenario.title,
|
||||
status: "pass",
|
||||
steps: [],
|
||||
})),
|
||||
startedScenarioIds: context.selectedScenarios.map((scenario) => scenario.id),
|
||||
watchUrl: "http://127.0.0.1:43123",
|
||||
runtimeParityCell: {
|
||||
runtime: params?.forcedRuntime ?? "openclaw",
|
||||
@@ -117,7 +125,7 @@ describe("runtime parity Control UI ownership", () => {
|
||||
])("preserves Control UI policy in both runtime cells for $label", async (testCase) => {
|
||||
const lab = createControlUiTestLab();
|
||||
|
||||
await runQaFlowSuiteFromRuntime({
|
||||
const result = await runQaFlowSuiteFromRuntime({
|
||||
repoRoot: "/qa-repo",
|
||||
outputDir: "/qa-output",
|
||||
providerMode: "mock-openai",
|
||||
@@ -137,5 +145,6 @@ describe("runtime parity Control UI ownership", () => {
|
||||
{ runtime: "openclaw", controlUiEnabled: testCase.enabled },
|
||||
{ runtime: "codex", controlUiEnabled: testCase.enabled },
|
||||
]);
|
||||
expect(result.startedScenarioIds).toEqual([testCase.scenarioId]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user