2
0

fix(results): 🐛 Display results for blocks w/ multiple inputs

This commit is contained in:
Baptiste Arnaud
2022-03-10 09:25:44 +01:00
parent 7e61ab19eb
commit 4767cdc542
7 changed files with 437 additions and 231 deletions

View File

@ -0,0 +1,23 @@
import test, { expect } from '@playwright/test'
import path from 'path'
import { importTypebotInDatabase } from '../services/database'
import { typebotViewer } from '../services/selectorUtils'
import { generate } from 'short-uuid'
test('should work as expected', async ({ page }) => {
const typebotId = generate()
await importTypebotInDatabase(
path.join(__dirname, '../fixtures/typebots/hugeBlock.json'),
{ id: typebotId, publicId: `${typebotId}-public` }
)
await page.goto(`/${typebotId}-public`)
await typebotViewer(page).locator('input').fill('Baptiste')
await typebotViewer(page).locator('input').press('Enter')
await typebotViewer(page).locator('input').fill('26')
await typebotViewer(page).locator('input').press('Enter')
await typebotViewer(page).locator('button >> text=Yes').click()
await page.goto(`http://localhost:3000/typebots/${typebotId}/results`)
await expect(page.locator('text=Baptiste')).toBeVisible()
await expect(page.locator('text=26')).toBeVisible()
await expect(page.locator('text=Yes')).toBeVisible()
})