feat : dont conflit with other editor
This commit is contained in:
@@ -41,4 +41,24 @@ describe("invalidation event envelopes", () => {
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("keeps valid scopes only on authenticated admin events", () => {
|
||||
const id = "4afeea7b-6f24-43f3-b747-2db98335e01e";
|
||||
expect(toInvalidationEvent({
|
||||
topic: "admin",
|
||||
aggregateId: id,
|
||||
eventType: "admin.updated",
|
||||
payload: { id, version: 4, scope: "team" },
|
||||
})).toEqual({ type: "admin.updated", id, version: 4, scope: "team" });
|
||||
expect(parseInvalidationEvent(JSON.stringify({ type: "admin.updated", id, version: 5, scope: `extra:${id}` })))
|
||||
.toEqual({ type: "admin.updated", id, version: 5, scope: `extra:${id}` });
|
||||
expect(parseInvalidationEvent(JSON.stringify({ type: "page.updated", id, version: 5, scope: "team" })))
|
||||
.toBeNull();
|
||||
expect(toInvalidationEvent({
|
||||
topic: "admin",
|
||||
aggregateId: id,
|
||||
eventType: "admin.updated",
|
||||
payload: { id, version: 6, scope: "unknown" },
|
||||
})).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user