Skip to content

Commit 2913b56

Browse files
committed
test(project-files): give new suites their own reports and drop an unreachable adapter case
1 parent daf2eb6 commit 2913b56

3 files changed

Lines changed: 8 additions & 21 deletions

File tree

‎apps/sim/lib/mothership/file-owners/workspace.test.ts‎

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,10 @@ beforeEach(() => {
2020
readMetadata.mockReset()
2121
})
2222

23-
it.each([
24-
[
25-
'keeps a chat upload on its uploads path so the reader resolves it',
26-
{ id: 'upload', name: 'notes.md', folderPath: null, vfsNamespace: 'uploads' },
27-
'uploads/notes.md',
28-
],
29-
[
30-
'places a workspace file under its folder path',
31-
{ id: 'file', name: 'notes.md', folderPath: 'Reports' },
32-
'files/Reports/notes.md',
33-
],
34-
])('%s', async (_name, stored, path) => {
35-
readMetadata.mockResolvedValue({ file: stored })
36-
const file = await workspaceFileOwnerAdapter.readChatMetadata(ingress, {
37-
owner,
38-
fileId: stored.id,
39-
})
40-
expect(file.path).toBe(path)
23+
it('places a workspace file under its folder path', async () => {
24+
readMetadata.mockResolvedValue({ file: { id: 'file', name: 'notes.md', folderPath: 'Reports' } })
25+
const file = await workspaceFileOwnerAdapter.readChatMetadata(ingress, { owner, fileId: 'file' })
26+
expect(file.path).toBe('files/Reports/notes.md')
4127
})
4228

4329
it('refuses a file owned by another workspace before reading its metadata', async () => {

‎apps/sim/lib/projects/files/__integration__/authorization-product.integration.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ async function grant(
153153

154154
afterAll(async () => {
155155
const reportPath =
156-
process.env.PROJECT_FILE_AUTHORIZATION_REPORT_PATH ??
157-
resolve('test-results/project-file-authorization.json')
156+
process.env.PROJECT_FILE_AUTHORIZATION_PRODUCT_REPORT_PATH ??
157+
resolve('test-results/project-file-authorization-product.json')
158158
await mkdir(dirname(reportPath), { recursive: true })
159159
await writeFile(reportPath, JSON.stringify({ checks }, null, 2))
160160
for (const f of fixtures) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ afterAll(async () => {
775775
}
776776
await rm(localStorageRoot, { recursive: true, force: true })
777777
const report =
778-
process.env.PROJECT_FILE_CONTENT_REPORT_PATH ?? 'test-results/project-file-content.json'
778+
process.env.PROJECT_FILE_CONTENT_PRODUCT_REPORT_PATH ??
779+
'test-results/project-file-content-product.json'
779780
await mkdir(dirname(report), { recursive: true })
780781
await writeFile(report, JSON.stringify({ checks }, null, 2))
781782
await closeRedisConnection()

0 commit comments

Comments
 (0)