2
0

feat(editor): Start preview from any block

This commit is contained in:
Baptiste Arnaud
2022-06-02 10:07:50 +02:00
parent 12f2e40152
commit 89d91f9114
15 changed files with 128 additions and 29 deletions

View File

@ -7,6 +7,7 @@ import {
import { defaultTextInputOptions, InputStepType } from 'models'
import path from 'path'
import cuid from 'cuid'
import { typebotViewer } from '../services/selectorUtils'
test.describe.parallel('Editor', () => {
test('Edges connection should work', async ({ page }) => {
@ -151,4 +152,29 @@ test.describe.parallel('Editor', () => {
await expect(page.locator('text="😍"')).toBeVisible()
await expect(page.locator('text="My superb typebot"')).toBeVisible()
})
test('Preview from group should work', async ({ page }) => {
const typebotId = cuid()
await importTypebotInDatabase(
path.join(__dirname, '../fixtures/typebots/editor/previewFromGroup.json'),
{
id: typebotId,
}
)
await page.goto(`/typebots/${typebotId}/edit`)
await page.click('[aria-label="Preview bot from this group"] >> nth=1')
await expect(
typebotViewer(page).locator('text="Hello this is group 1"')
).toBeVisible()
await page.click('[aria-label="Preview bot from this group"] >> nth=2')
await expect(
typebotViewer(page).locator('text="Hello this is group 2"')
).toBeVisible()
await page.click('[aria-label="Close"]')
await page.click('text="Preview"')
await expect(
typebotViewer(page).locator('text="Hello this is group 1"')
).toBeVisible()
})
})