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: [email protected] <[email protected]>

* fix: add beforeAll cleanup to prevent test flakes from leftover data

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-12 18:54:29 -03:00
1 parent 2f90138757
commit 9202028ab6
1 file changed
+5 -2
@@ -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);