fix: Server error when attempting to update team with identical details to previous

This commit is contained in:
Tom Moor
2020-12-04 08:01:22 -08:00
parent aa6fc45097
commit 6c1ecde4e7
2 changed files with 23 additions and 10 deletions

View File

@ -21,6 +21,17 @@ describe("#team.update", () => {
expect(body.data.name).toEqual("New name");
});
it("should allow identical team details", async () => {
const { admin, team } = await seed();
const res = await server.post("/api/team.update", {
body: { token: admin.getJwtToken(), name: team.name },
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.name).toEqual(team.name);
});
it("should require admin", async () => {
const { user } = await seed();
const res = await server.post("/api/team.update", {