2022-09-17 16:37:33 +02:00
|
|
|
import test, { expect } from '@playwright/test'
|
|
|
|
import {
|
|
|
|
createResults,
|
|
|
|
importTypebotInDatabase,
|
2022-09-24 08:58:23 +02:00
|
|
|
limitTestWorkspaceId,
|
2022-09-17 16:37:33 +02:00
|
|
|
} from '../services/database'
|
|
|
|
import cuid from 'cuid'
|
|
|
|
import path from 'path'
|
|
|
|
|
|
|
|
test('should not start if chat limit is reached', async ({ page }) => {
|
|
|
|
const typebotId = cuid()
|
|
|
|
await importTypebotInDatabase(
|
|
|
|
path.join(__dirname, '../fixtures/typebots/fileUpload.json'),
|
|
|
|
{
|
|
|
|
id: typebotId,
|
|
|
|
publicId: `${typebotId}-public`,
|
2022-09-24 08:58:23 +02:00
|
|
|
workspaceId: limitTestWorkspaceId,
|
2022-09-17 16:37:33 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
await createResults({ typebotId, count: 320 })
|
|
|
|
await page.goto(`/${typebotId}-public`)
|
|
|
|
await expect(page.locator('text="This bot is now closed."')).toBeVisible()
|
|
|
|
})
|