Skip to content

Commit 909a4a6

Browse files
committed
test(googlechat): add replyToMode 'off' config resolution tests
Verify that replyToMode: 'off' resolves correctly at both the channel level and as a per-account override through the threading adapter. Documents the config contract that monitor.ts now honors.
1 parent 8ecb3d0 commit 909a4a6

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

extensions/googlechat/src/channel.test.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,3 +693,56 @@ describe("googlechatPlugin security", () => {
693693
);
694694
});
695695
});
696+
697+
698+
describe("googlechatPlugin threading replyToMode off", () => {
699+
it("resolves replyToMode 'off' from channel config", () => {
700+
const cfg = {
701+
channels: {
702+
googlechat: {
703+
replyToMode: "off",
704+
},
705+
},
706+
} as OpenClawConfig;
707+
708+
const account = googlechatThreadingAdapter.scopedAccountReplyToMode.resolveAccount(
709+
cfg,
710+
"default",
711+
);
712+
713+
expect(
714+
googlechatThreadingAdapter.scopedAccountReplyToMode.resolveReplyToMode(account),
715+
).toBe("off");
716+
});
717+
718+
it("resolves replyToMode 'off' per-account override", () => {
719+
const cfg = {
720+
channels: {
721+
googlechat: {
722+
replyToMode: "all",
723+
accounts: {
724+
dm: {
725+
replyToMode: "off",
726+
},
727+
},
728+
},
729+
},
730+
} as OpenClawConfig;
731+
732+
const dmAccount = googlechatThreadingAdapter.scopedAccountReplyToMode.resolveAccount(
733+
cfg,
734+
"dm",
735+
);
736+
const defaultAccount = googlechatThreadingAdapter.scopedAccountReplyToMode.resolveAccount(
737+
cfg,
738+
"default",
739+
);
740+
741+
expect(
742+
googlechatThreadingAdapter.scopedAccountReplyToMode.resolveReplyToMode(dmAccount),
743+
).toBe("off");
744+
expect(
745+
googlechatThreadingAdapter.scopedAccountReplyToMode.resolveReplyToMode(defaultAccount),
746+
).toBe("all");
747+
});
748+
});

0 commit comments

Comments
 (0)