feat: Allow deletion of imports (#5907)
This commit is contained in:
@@ -216,48 +216,6 @@ describe("#team.update", () => {
|
||||
expect(body.data.defaultCollectionId).toEqual(collection.id);
|
||||
});
|
||||
|
||||
it("should default to home if default collection is deleted", async () => {
|
||||
const team = await buildTeam();
|
||||
const admin = await buildAdmin({ teamId: team.id });
|
||||
const collection = await buildCollection({
|
||||
teamId: team.id,
|
||||
userId: admin.id,
|
||||
});
|
||||
|
||||
await buildCollection({
|
||||
teamId: team.id,
|
||||
userId: admin.id,
|
||||
});
|
||||
|
||||
const res = await server.post("/api/team.update", {
|
||||
body: {
|
||||
token: admin.getJwtToken(),
|
||||
defaultCollectionId: collection.id,
|
||||
},
|
||||
});
|
||||
|
||||
const body = await res.json();
|
||||
expect(res.status).toEqual(200);
|
||||
expect(body.data.defaultCollectionId).toEqual(collection.id);
|
||||
|
||||
const deleteRes = await server.post("/api/collections.delete", {
|
||||
body: {
|
||||
token: admin.getJwtToken(),
|
||||
id: collection.id,
|
||||
},
|
||||
});
|
||||
expect(deleteRes.status).toEqual(200);
|
||||
|
||||
const res3 = await server.post("/api/auth.info", {
|
||||
body: {
|
||||
token: admin.getJwtToken(),
|
||||
},
|
||||
});
|
||||
const body3 = await res3.json();
|
||||
expect(res3.status).toEqual(200);
|
||||
expect(body3.data.team.defaultCollectionId).toEqual(null);
|
||||
});
|
||||
|
||||
it("should update default collection to null when collection is made private", async () => {
|
||||
const team = await buildTeam();
|
||||
const admin = await buildAdmin({ teamId: team.id });
|
||||
|
||||
Reference in New Issue
Block a user