Nodes tests: cover pull-time policy recheck

This commit is contained in:
Vincent Koc 2026-03-14 23:16:11 -07:00
parent c133fc6a49
commit cfaf4d9212
1 changed files with 4 additions and 1 deletions

View File

@ -520,7 +520,8 @@ describe("node.invoke APNs wake path", () => {
it("drops queued actions that are no longer allowed at pull time", async () => { it("drops queued actions that are no longer allowed at pull time", async () => {
mocks.loadApnsRegistration.mockResolvedValue(null); 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( mocks.isNodeCommandAllowed.mockImplementation(
({ ({
command, command,
@ -566,6 +567,8 @@ describe("node.invoke APNs wake path", () => {
}, },
}); });
allowlistedCommands.delete("camera.snap");
const pullRespond = await pullPending("ios-node-policy"); const pullRespond = await pullPending("ios-node-policy");
const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined; const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined;
expect(pullCall?.[0]).toBe(true); expect(pullCall?.[0]).toBe(true);