Run attachments only on internal

This commit is contained in:
Adria Navarro 2023-09-12 18:07:50 +02:00
parent 88c68cfe58
commit a537b17b23
1 changed files with 23 additions and 22 deletions

View File

@ -853,31 +853,32 @@ describe.each([
}) })
}) })
describe("attachments", () => { isInternal &&
it("should allow enriching attachment rows", async () => { describe("attachments", () => {
const table = await config.createAttachmentTable() it("should allow enriching attachment rows", async () => {
const attachmentId = `${structures.uuid()}.csv` const table = await config.createAttachmentTable()
const row = await createRow(table._id, { const attachmentId = `${structures.uuid()}.csv`
name: "test", const row = await createRow(table._id, {
description: "test", name: "test",
attachment: [ description: "test",
{ attachment: [
key: `${config.getAppId()}/attachments/${attachmentId}`, {
}, key: `${config.getAppId()}/attachments/${attachmentId}`,
], },
tableId: table._id, ],
}) tableId: table._id,
// the environment needs configured for this })
await setup.switchToSelfHosted(async () => { // the environment needs configured for this
return context.doInAppContext(config.getAppId(), async () => { await setup.switchToSelfHosted(async () => {
const enriched = await outputProcessing(table, [row]) return context.doInAppContext(config.getAppId(), async () => {
expect((enriched as Row[])[0].attachment[0].url).toBe( const enriched = await outputProcessing(table, [row])
`/files/signed/prod-budi-app-assets/${config.getProdAppId()}/attachments/${attachmentId}` expect((enriched as Row[])[0].attachment[0].url).toBe(
) `/files/signed/prod-budi-app-assets/${config.getProdAppId()}/attachments/${attachmentId}`
)
})
}) })
}) })
}) })
})
describe("exportData", () => { describe("exportData", () => {
it("should allow exporting all columns", async () => { it("should allow exporting all columns", async () => {