Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

merge the overlapping hardDelete e2e tests

DimitrisStaratzisf6b24f71d3eb
diff --git a/backend/e2e-test/routes/v1/project.spec.ts b/backend/e2e-test/routes/v1/project.spec.ts
index 813a794807..5fad62bf74 100644
--- a/backend/e2e-test/routes/v1/project.spec.ts
+++ b/backend/e2e-test/routes/v1/project.spec.ts
@@ -116,13 +116,17 @@ describe("Project deletion (soft-delete + async cleanup)", async () => {
expect((await listProjects()).some((p) => p.id === project.id)).toBe(false);
});
- test("hardDelete frees the slug so a same-slug project can be recreated immediately", async () => {
+ test("hardDelete skips the grace period and frees the slug right away", async () => {
const slug = "e2e-slug-reuse-test";
const first = await createProject("e2e-slug-reuse-1", slug);
expect(first.slug).toBe(slug);
expect((await deleteProject(first.id, true)).statusCode).toBe(200);
+ expect((await listDeletedProjects()).some((p) => p.id === first.id)).toBe(false);
+ // 400 while it awaits the cleanup worker, 404 once the worker has removed it
+ expect([400, 404]).toContain((await restoreProject(first.id)).statusCode);
+
// recreating with the same slug must succeed (slug was tombstoned on delete)
const second = await createProject("e2e-slug-reuse-2", slug);
expect(second.slug).toBe(slug);
@@ -195,15 +199,6 @@ describe("Project deletion (soft-delete + async cleanup)", async () => {
await deleteProject(project.id, true);
});
-
- test("hardDelete skips the grace period so the project cannot be restored", async () => {
- const project = await createProject("e2e-hard-delete");
- expect((await deleteProject(project.id, true)).statusCode).toBe(200);
-
- expect((await listDeletedProjects()).some((p) => p.id === project.id)).toBe(false);
- // 400 while it awaits the cleanup worker, 404 once the worker has removed it
- expect([400, 404]).toContain((await restoreProject(project.id)).statusCode);
- });
});
describe("Project update (audit logs retention)", async () => {