test: dedupe channel setup mock reads

This commit is contained in:
Peter Steinberger
2026-05-12 23:54:01 +01:00
parent 4cd356fa2a
commit 73907fdf5c

View File

@@ -208,10 +208,7 @@ function expectSetupSnapshotDoesNotScopeToPlugin(params: {
});
expect(loadOpenClawPlugins).toHaveBeenCalledTimes(1);
const firstLoadCall = vi.mocked(loadOpenClawPlugins).mock.calls.at(0)?.[0] as
| { onlyPluginIds?: string[] }
| undefined;
expect(firstLoadCall?.onlyPluginIds).toStrictEqual([]);
expect(requireMockCallArg(vi.mocked(loadOpenClawPlugins), 0).onlyPluginIds).toStrictEqual([]);
}
beforeEach(() => {
@@ -300,11 +297,7 @@ async function runInitialValueForChannel(channel: "dev" | "beta") {
runtime,
});
const call = select.mock.calls.at(0);
if (!call) {
throw new Error("Expected select call");
}
return call[0]?.initialValue;
return requireMockCallArg(select, 0).initialValue;
}
function expectPluginLoadedFromLocalPath(