2
0

Introduce bot v2 in builder (#328)

Also, the new engine is the default for updated typebots for viewer

Closes #211
This commit is contained in:
Baptiste Arnaud
2023-02-21 15:25:14 +01:00
committed by GitHub
parent 527dc8a5b1
commit debdac12ff
208 changed files with 4462 additions and 5236 deletions

View File

@@ -2,7 +2,6 @@ import { getTestAsset } from '@/test/utils/playwright'
import test, { expect } from '@playwright/test'
import { createId } from '@paralleldrive/cuid2'
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
import { typebotViewer } from 'utils/playwright/testHelpers'
test('should correctly be injected', async ({ page }) => {
const typebotId = createId()
@@ -11,12 +10,10 @@ test('should correctly be injected', async ({ page }) => {
{ id: typebotId, publicId: `${typebotId}-public` }
)
await page.goto(`/${typebotId}-public`)
await expect(typebotViewer(page).locator('text="Your name is"')).toBeVisible()
await expect(page.locator('text="Your name is"')).toBeVisible()
await page.goto(`/${typebotId}-public?Name=Baptiste&Email=email@test.com`)
await expect(
typebotViewer(page).locator('text="Your name is Baptiste"')
).toBeVisible()
await expect(
typebotViewer(page).locator('input[value="email@test.com"]')
).toBeVisible()
await expect(page.locator('text="Your name is Baptiste"')).toBeVisible()
await expect(page.getByPlaceholder('Type your email...')).toHaveValue(
'email@test.com'
)
})

View File

@@ -1,21 +0,0 @@
import { getTestAsset } from '@/test/utils/playwright'
import test, { expect } from '@playwright/test'
import { createId } from '@paralleldrive/cuid2'
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
test('should correctly be injected', async ({ page }) => {
const typebotId = createId()
await importTypebotInDatabase(
getTestAsset('typebots/predefinedVariables.json'),
{ id: typebotId, publicId: `${typebotId}-public` }
)
await page.goto(`/next/${typebotId}-public`)
await expect(page.locator('text="Your name is"')).toBeVisible()
await page.goto(
`/next/${typebotId}-public?Name=Baptiste&Email=email@test.com`
)
await expect(page.locator('text="Your name is Baptiste"')).toBeVisible()
await expect(page.getByPlaceholder('Type your email...')).toHaveValue(
'email@test.com'
)
})