2
0

♻️ Rename Code block to Script block

Closes #245
This commit is contained in:
Baptiste Arnaud
2023-01-27 15:58:05 +01:00
parent 068f9bbd17
commit a842f57297
35 changed files with 113 additions and 103 deletions

View File

@ -0,0 +1,26 @@
import test, { expect } from '@playwright/test'
import { typebotViewer } from 'utils/playwright/testHelpers'
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
import cuid from 'cuid'
import { getTestAsset } from '@/test/utils/playwright'
const typebotId = cuid()
test.describe('Script block', () => {
test('script should trigger', async ({ page }) => {
await importTypebotInDatabase(getTestAsset('typebots/logic/script.json'), {
id: typebotId,
})
await page.goto(`/typebots/${typebotId}/edit`)
await page.click('text=Configure...')
await page.fill(
'div[role="textbox"]',
'window.location.href = "https://www.google.com"'
)
await page.click('text=Preview')
await typebotViewer(page).locator('text=Trigger code').click()
await expect(page).toHaveURL('https://www.google.com')
})
})