Skip to content

Commit a4d98d7

Browse files
committed
test(project-files): explicitly retire fixture shares during teardown
1 parent b26996c commit a4d98d7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/sim/lib/projects/files/__integration__/content-sharing.integration.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { featureFlagsMock, featureFlagsMockFns } from '@sim/testing/mocks/featur
2727
import { setUploadDirServer, uploadsSetupMock } from '@sim/testing/mocks/uploads-setup.mock'
2828
import { getErrorMessage } from '@sim/utils/errors'
2929
import { generateId } from '@sim/utils/id'
30-
import { eq, inArray, sql } from 'drizzle-orm'
30+
import { and, eq, inArray, sql } from 'drizzle-orm'
3131
import { NextResponse } from 'next/server'
3232
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest'
3333

@@ -927,6 +927,9 @@ afterAll(async () => {
927927
.where(
928928
sql`${outboxEvent.payload}::jsonb ->> 'key' LIKE ${`project/${f.projectId}/%`} OR ${outboxEvent.payload}::jsonb -> 'owner' ->> 'entityId' = ${f.projectId}`
929929
)
930+
await db
931+
.delete(publicShare)
932+
.where(and(eq(publicShare.entityType, 'project'), eq(publicShare.entityId, f.projectId)))
930933
await db.delete(workspaceFiles).where(eq(workspaceFiles.projectId, f.projectId))
931934
await db.delete(folder).where(eq(folder.projectId, f.projectId))
932935
await deleteWorkspaceFixture(db, eq(workspace.id, f.workspaceId))

0 commit comments

Comments
 (0)