



























@@ -35,12 +35,11 @@ describe("plugin-sdk/channel-ingress-runtime", () => {
3535command: { useAccessGroups: true, allowTextCommands: true, hasControlCommand: true },
3636});
373738-expect(projectIngressAccessFacts(commandMessage.ingress).commands).toMatchObject({
39-authorized: true,
40-authorizers: [],
41-useAccessGroups: true,
42-allowTextCommands: true,
43-});
38+const commandFacts = projectIngressAccessFacts(commandMessage.ingress).commands;
39+expect(commandFacts?.authorized).toBe(true);
40+expect(commandFacts?.authorizers).toEqual([]);
41+expect(commandFacts?.useAccessGroups).toBe(true);
42+expect(commandFacts?.allowTextCommands).toBe(true);
4443});
45444645it("keeps command authorizers required on public AccessFacts", () => {
@@ -60,7 +59,8 @@ describe("plugin-sdk/channel-ingress-runtime", () => {
6059command: { useAccessGroups: true, allowTextCommands: true, hasControlCommand: true },
6160});
6261expect(readStoreAllowFrom).toHaveBeenCalledOnce();
63-expect(allowed.ingress).toMatchObject({ admission: "dispatch", decision: "allow" });
62+expect(allowed.ingress.admission).toBe("dispatch");
63+expect(allowed.ingress.decision).toBe("allow");
6464expect(allowed.commandAccess.authorized).toBe(true);
6565expect(JSON.stringify(allowed.state)).not.toContain(sender);
6666expect(JSON.stringify(allowed.ingress)).not.toContain(sender);
@@ -89,10 +89,8 @@ describe("plugin-sdk/channel-ingress-runtime", () => {
8989},
9090});
9191expect(unauthorizedCommand.ingress.reasonCode).toBe("control_command_unauthorized");
92-expect(unauthorizedCommand.senderAccess).toMatchObject({
93-decision: "allow",
94-reasonCode: "group_policy_open",
95-});
92+expect(unauthorizedCommand.senderAccess.decision).toBe("allow");
93+expect(unauthorizedCommand.senderAccess.reasonCode).toBe("group_policy_open");
9694expect(unauthorizedCommand.commandAccess.shouldBlockControlCommand).toBe(true);
9795});
9896此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。