2
0

refactor(editor): ♻️ Undo / Redo buttons + structure refacto

Yet another huge refacto... While implementing undo and redo features I understood that I updated the stored typebot too many times (i.e. on each key input) so I had to rethink it entirely. I also moved around some files.
This commit is contained in:
Baptiste Arnaud
2022-02-02 08:05:02 +01:00
parent fc1d654772
commit 8a350eee6c
153 changed files with 1512 additions and 1352 deletions

View File

@ -1,9 +1,10 @@
import test, { expect, Page } from '@playwright/test'
import test, { expect } from '@playwright/test'
import path from 'path'
import { typebotViewer } from '../../services/selectorUtils'
import { importTypebotInDatabase } from '../../services/database'
import { generate } from 'short-uuid'
const typebotId = 'condition-step'
const typebotId = generate()
test.describe('Condition step', () => {
test('its configuration should work', async ({ page }) => {
@ -16,6 +17,7 @@ test.describe('Condition step', () => {
await page.goto(`/typebots/${typebotId}/edit`)
await page.click('text=Configure...')
await page.click('button:has-text("Add a comparison")')
await page.fill(
'input[placeholder="Search for a variable"] >> nth=-1',
'Age'
@ -40,6 +42,7 @@ test.describe('Condition step', () => {
)
await page.click('text=Configure...')
await page.click('button:has-text("Add a comparison")')
await page.fill(
'input[placeholder="Search for a variable"] >> nth=-1',
'Age'

View File

@ -2,8 +2,9 @@ import test, { expect } from '@playwright/test'
import path from 'path'
import { typebotViewer } from '../../services/selectorUtils'
import { importTypebotInDatabase } from '../../services/database'
import { generate } from 'short-uuid'
const typebotId = 'redirect-step'
const typebotId = generate()
test.describe('Redirect step', () => {
test('its configuration should work', async ({ page, context }) => {

View File

@ -2,8 +2,9 @@ import test, { expect } from '@playwright/test'
import path from 'path'
import { typebotViewer } from '../../services/selectorUtils'
import { importTypebotInDatabase } from '../../services/database'
import { generate } from 'short-uuid'
const typebotId = 'set-variable-step'
const typebotId = generate()
test.describe('Set variable step', () => {
test('its configuration should work', async ({ page }) => {
@ -24,7 +25,7 @@ test.describe('Set variable step', () => {
await page.click('text=Create "Total"')
await page.fill('textarea', '1000 * {{Num}}')
await page.click('text=Click to edit...')
await page.click('text=Click to edit...', { force: true })
await page.fill(
'input[placeholder="Select a variable"] >> nth=-1',
'Custom var'