fix: Incorrect policies returned from documents.update (#7111)

* fix: Incorrect policies returned from documents.update

* Regression test
This commit is contained in:
Tom Moor
2024-06-21 19:37:39 -04:00
committed by GitHub
parent 4897f001e4
commit 9e5d5c0347
2 changed files with 5 additions and 4 deletions

View File

@@ -3316,13 +3316,14 @@ describe("#documents.update", () => {
body: {
token: user.getJwtToken(),
id: document.id,
text: "Changed text",
title: "Changed text",
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.text).toBe("Changed text");
expect(body.data.title).toBe("Changed text");
expect(body.data.updatedBy.id).toBe(user.id);
expect(body.policies[0].abilities.update).toEqual(true);
});
it("does not allow editing by read-only collection user", async () => {