2
0

refactor: ♻️ Rename step to block

This commit is contained in:
Baptiste Arnaud
2022-06-11 07:27:38 +02:00
parent 8751766d0e
commit 2df8338505
297 changed files with 4292 additions and 3989 deletions

View File

@@ -1,24 +1,24 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultChoiceInputOptions, InputStepType, ItemType } from 'models'
import { defaultChoiceInputOptions, InputBlockType, ItemType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe.parallel('Buttons input step', () => {
test.describe.parallel('Buttons input block', () => {
test('can edit button items', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.CHOICE,
...parseDefaultGroupWithBlock({
type: InputBlockType.CHOICE,
items: [
{
id: 'choice1',
stepId: 'step1',
blockId: 'block1',
type: ItemType.BUTTON,
},
],
@@ -46,10 +46,10 @@ test.describe.parallel('Buttons input step', () => {
await expect(typebotViewer(page).locator('text=Item 3')).toBeVisible()
await page.click('button[aria-label="Close"]')
await page.click('[data-testid="step1-icon"]')
await page.click('[data-testid="block1-icon"]')
await page.click('text=Multiple choice?')
await page.fill('#button', 'Go')
await page.click('[data-testid="step1-icon"]')
await page.click('[data-testid="block1-icon"]')
await page.locator('text=Item 1').hover()
await page.click('[aria-label="Add item"]')

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultDateInputOptions, InputStepType } from 'models'
import { defaultDateInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe('Date input step', () => {
test.describe('Date input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.DATE,
...parseDefaultGroupWithBlock({
type: InputBlockType.DATE,
options: defaultDateInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultEmailInputOptions, InputStepType } from 'models'
import { defaultEmailInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe('Email input step', () => {
test.describe('Email input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.EMAIL,
...parseDefaultGroupWithBlock({
type: InputBlockType.EMAIL,
options: defaultEmailInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultNumberInputOptions, InputStepType } from 'models'
import { defaultNumberInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe('Number input step', () => {
test.describe('Number input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.NUMBER,
...parseDefaultGroupWithBlock({
type: InputBlockType.NUMBER,
options: defaultNumberInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultPaymentInputOptions, InputStepType } from 'models'
import { defaultPaymentInputOptions, InputBlockType } from 'models'
import cuid from 'cuid'
import { stripePaymentForm, typebotViewer } from '../../services/selectorUtils'
test.describe('Payment input step', () => {
test.describe('Payment input block', () => {
test('Can configure Stripe account', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.PAYMENT,
...parseDefaultGroupWithBlock({
type: InputBlockType.PAYMENT,
options: defaultPaymentInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultPhoneInputOptions, InputStepType } from 'models'
import { defaultPhoneInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe('Phone input step', () => {
test.describe('Phone input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.PHONE,
...parseDefaultGroupWithBlock({
type: InputBlockType.PHONE,
options: defaultPhoneInputOptions,
}),
},

View File

@@ -1,9 +1,9 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultRatingInputOptions, InputStepType } from 'models'
import { defaultRatingInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
@@ -25,8 +25,8 @@ test('options should work', async ({ page }) => {
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.RATING,
...parseDefaultGroupWithBlock({
type: InputBlockType.RATING,
options: defaultRatingInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultTextInputOptions, InputStepType } from 'models'
import { defaultTextInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe.parallel('Text input step', () => {
test.describe.parallel('Text input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.TEXT,
...parseDefaultGroupWithBlock({
type: InputBlockType.TEXT,
options: defaultTextInputOptions,
}),
},

View File

@@ -1,20 +1,20 @@
import test, { expect } from '@playwright/test'
import {
createTypebots,
parseDefaultBlockWithStep,
parseDefaultGroupWithBlock,
} from '../../services/database'
import { defaultUrlInputOptions, InputStepType } from 'models'
import { defaultUrlInputOptions, InputBlockType } from 'models'
import { typebotViewer } from '../../services/selectorUtils'
import cuid from 'cuid'
test.describe('Url input step', () => {
test.describe('Url input block', () => {
test('options should work', async ({ page }) => {
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
...parseDefaultBlockWithStep({
type: InputStepType.URL,
...parseDefaultGroupWithBlock({
type: InputBlockType.URL,
options: defaultUrlInputOptions,
}),
},