mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
test: isolate task flow owner registry
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
findLatestTaskFlowForOwner,
|
||||
getTaskFlowByIdForOwner,
|
||||
@@ -6,10 +6,24 @@ import {
|
||||
resolveTaskFlowForLookupTokenForOwner,
|
||||
} from "./task-flow-owner-access.js";
|
||||
import { createManagedTaskFlow, resetTaskFlowRegistryForTests } from "./task-flow-registry.js";
|
||||
import { configureTaskFlowRegistryRuntime } from "./task-flow-registry.store.js";
|
||||
|
||||
beforeEach(() => {
|
||||
resetTaskFlowRegistryForTests();
|
||||
configureTaskFlowRegistryRuntime({
|
||||
store: {
|
||||
loadSnapshot: () => ({ flows: new Map() }),
|
||||
saveSnapshot: () => {},
|
||||
upsertFlow: () => {},
|
||||
deleteFlow: () => {},
|
||||
},
|
||||
});
|
||||
resetTaskFlowRegistryForTests({ persist: false });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
resetTaskFlowRegistryForTests({ persist: false });
|
||||
});
|
||||
|
||||
describe("task flow owner access", () => {
|
||||
it("returns owner-scoped flows for direct and owner-key lookups", () => {
|
||||
const older = createManagedTaskFlow({
|
||||
|
||||
Reference in New Issue
Block a user