@@ -734,7 +734,7 @@ describe("msteams monitor handler authz", () => {
|
734 | 734 | expect(ctxPayload.CommandAuthorized).toBe(true); |
735 | 735 | }); |
736 | 736 | |
737 | | -it("marks skipped channel message system events as non-owner", async () => { |
| 737 | +it("marks skipped channel message system events as non-owner without duplicating body text", async () => { |
738 | 738 | resetThreadMocks(); |
739 | 739 | const { deps, enqueueSystemEvent } = createDeps({ |
740 | 740 | channels: { |
@@ -768,15 +768,16 @@ describe("msteams monitor handler authz", () => {
|
768 | 768 | |
769 | 769 | expect(runtimeApiMockState.dispatchReplyFromConfigWithSettledDispatcher).not.toHaveBeenCalled(); |
770 | 770 | const systemEventCall = enqueueSystemEvent.mock.calls.find( |
771 | | -([text]) => typeof text === "string" && text.includes("please run the deployment"), |
| 771 | +([text]) => text === "Teams message in channel from Member", |
772 | 772 | ); |
773 | 773 | if (!systemEventCall) { |
774 | 774 | throw new Error("expected skipped Teams message system event"); |
775 | 775 | } |
776 | 776 | expect(systemEventCall[1]).toMatchObject({}); |
| 777 | +expect(systemEventCall[0]).not.toContain("please run the deployment"); |
777 | 778 | }); |
778 | 779 | |
779 | | -it("keeps dispatched primary message system events owner-neutral", async () => { |
| 780 | +it("keeps dispatched primary message system events owner-neutral without duplicating body text", async () => { |
780 | 781 | resetThreadMocks(); |
781 | 782 | const { deps, enqueueSystemEvent } = createDeps({ |
782 | 783 | channels: { |
@@ -810,11 +811,14 @@ describe("msteams monitor handler authz", () => {
|
810 | 811 | |
811 | 812 | expect(runtimeApiMockState.dispatchReplyFromConfigWithSettledDispatcher).toHaveBeenCalled(); |
812 | 813 | const systemEventCall = enqueueSystemEvent.mock.calls.find( |
813 | | -([text]) => typeof text === "string" && text.includes("please check the build"), |
| 814 | +([text]) => text === "Teams message in channel from Member", |
814 | 815 | ); |
815 | 816 | if (!systemEventCall) { |
816 | 817 | throw new Error("expected active Teams message system event"); |
817 | 818 | } |
| 819 | +expect(systemEventCall[0]).not.toContain("please check the build"); |
| 820 | +const dispatched = firstSettledDispatch(); |
| 821 | +expect(recordFromMockCall(dispatched.ctxPayload).BodyForAgent).toBe("please check the build"); |
818 | 822 | }); |
819 | 823 | |
820 | 824 | it("authorizes text control commands from static access groups", async () => { |
|