mirror of https://github.com/openclaw/openclaw.git
test: tighten channel activity account isolation
This commit is contained in:
parent
a23a23ba69
commit
9050aa9efd
|
|
@ -60,6 +60,30 @@ describe("channel activity", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("keeps activity isolated per account on the same channel", () => {
|
||||
recordChannelActivity({
|
||||
channel: "telegram",
|
||||
accountId: "team-a",
|
||||
direction: "inbound",
|
||||
at: 10,
|
||||
});
|
||||
recordChannelActivity({
|
||||
channel: "telegram",
|
||||
accountId: "team-b",
|
||||
direction: "outbound",
|
||||
at: 20,
|
||||
});
|
||||
|
||||
expect(getChannelActivity({ channel: "telegram", accountId: "team-a" })).toEqual({
|
||||
inboundAt: 10,
|
||||
outboundAt: null,
|
||||
});
|
||||
expect(getChannelActivity({ channel: "telegram", accountId: " team-b " })).toEqual({
|
||||
inboundAt: null,
|
||||
outboundAt: 20,
|
||||
});
|
||||
});
|
||||
|
||||
it("reset clears previously recorded activity", () => {
|
||||
recordChannelActivity({ channel: "line", direction: "outbound", at: 7 });
|
||||
resetChannelActivityForTest();
|
||||
|
|
|
|||
Loading…
Reference in New Issue