2
0

♻️ Remove storage limit related code

This commit is contained in:
Baptiste Arnaud
2023-09-20 16:06:53 +02:00
parent 7d57e8dd06
commit d7dc5fb5fb
25 changed files with 44 additions and 493 deletions

View File

@ -3,17 +3,10 @@ import { createId } from '@paralleldrive/cuid2'
import { parse } from 'papaparse'
import { readFileSync } from 'fs'
import { isDefined } from '@typebot.io/lib'
import {
createWorkspaces,
importTypebotInDatabase,
injectFakeResults,
} from '@typebot.io/lib/playwright/databaseActions'
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions'
import { getTestAsset } from '@/test/utils/playwright'
import { Plan } from '@typebot.io/prisma'
import { env } from '@typebot.io/env'
const THREE_GIGABYTES = 3 * 1024 * 1024 * 1024
test('should work as expected', async ({ page, browser }) => {
const typebotId = createId()
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
@ -75,22 +68,3 @@ test('should work as expected', async ({ page, browser }) => {
await page2.goto(urls[0])
await expect(page2.locator('pre')).toBeHidden()
})
test.describe('Storage limit is reached', () => {
const typebotId = createId()
const workspaceId = createId()
test.beforeAll(async () => {
await createWorkspaces([{ id: workspaceId, plan: Plan.STARTER }])
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
id: typebotId,
publicId: `${typebotId}-public`,
workspaceId,
})
await injectFakeResults({
typebotId,
count: 20,
fakeStorage: THREE_GIGABYTES,
})
})
})

View File

@ -1,10 +1,10 @@
import test, { expect } from '@playwright/test'
import { createId } from '@paralleldrive/cuid2'
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions'
import { getTestAsset } from '@/test/utils/playwright'
import { SmtpCredentials } from '@typebot.io/schemas'
import { env } from '@typebot.io/env'
import { createSmtpCredentials } from './utils/databaseActions'
import { getTestAsset } from './utils/playwright'
export const mockSmtpCredentials: SmtpCredentials['data'] = {
from: {