mirror of https://github.com/openclaw/openclaw.git
Nodes tests: cover pull-time policy recheck
This commit is contained in:
parent
c133fc6a49
commit
cfaf4d9212
|
|
@ -520,7 +520,8 @@ describe("node.invoke APNs wake path", () => {
|
|||
|
||||
it("drops queued actions that are no longer allowed at pull time", async () => {
|
||||
mocks.loadApnsRegistration.mockResolvedValue(null);
|
||||
mocks.resolveNodeCommandAllowlist.mockReturnValue(new Set(["canvas.navigate"]));
|
||||
const allowlistedCommands = new Set(["camera.snap", "canvas.navigate"]);
|
||||
mocks.resolveNodeCommandAllowlist.mockImplementation(() => new Set(allowlistedCommands));
|
||||
mocks.isNodeCommandAllowed.mockImplementation(
|
||||
({
|
||||
command,
|
||||
|
|
@ -566,6 +567,8 @@ describe("node.invoke APNs wake path", () => {
|
|||
},
|
||||
});
|
||||
|
||||
allowlistedCommands.delete("camera.snap");
|
||||
|
||||
const pullRespond = await pullPending("ios-node-policy");
|
||||
const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined;
|
||||
expect(pullCall?.[0]).toBe(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue