From 9202028ab63dffdfedc13a2984c5f27af56ff903 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 13 Jan 2026 03:24:29 +0530 Subject: [PATCH] fix: resolve API v2 test flakes with cleanup and simplified slug (#26766) * fix: resolve API v2 test flakes by using UUID-only slug Co-Authored-By: anik@cal.com * fix: add beforeAll cleanup to prevent test flakes from leftover data Co-Authored-By: anik@cal.com --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- ...organizations-member-team-admin-event-types.e2e-spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/v2/src/modules/organizations/event-types/organizations-member-team-admin-event-types.e2e-spec.ts b/apps/api/v2/src/modules/organizations/event-types/organizations-member-team-admin-event-types.e2e-spec.ts index 3fd172d176..816a37efe9 100644 --- a/apps/api/v2/src/modules/organizations/event-types/organizations-member-team-admin-event-types.e2e-spec.ts +++ b/apps/api/v2/src/modules/organizations/event-types/organizations-member-team-admin-event-types.e2e-spec.ts @@ -65,8 +65,7 @@ describe("Organizations Event Types Endpoints", () => { let managedEventTypeSlug: string; beforeAll(async () => { - // Generate unique slug inside beforeAll to ensure uniqueness across test runs - managedEventTypeSlug = `organizations-event-types-managed-${Date.now()}-${randomString()}`; + managedEventTypeSlug = `organizations-event-types-managed-${randomString()}`; const moduleRef = await withApiAuth( userEmail, Test.createTestingModule({ @@ -207,6 +206,10 @@ describe("Organizations Event Types Endpoints", () => { accepted: true, }); + await eventTypesRepositoryFixture.deleteAllUserEventTypes(teammate1.id); + await eventTypesRepositoryFixture.deleteAllUserEventTypes(teammate2.id); + await eventTypesRepositoryFixture.deleteAllTeamEventTypes(team.id); + app = moduleRef.createNestApplication(); bootstrap(app as NestExpressApplication);