Add e2e tests for account
This commit is contained in:
@ -1,7 +1,55 @@
|
||||
import { Step, TextStep, StepType, TextInputStep } from '../models'
|
||||
import { Prisma } from 'db'
|
||||
import {
|
||||
Step,
|
||||
TextStep,
|
||||
StepType,
|
||||
TextInputStep,
|
||||
BackgroundType,
|
||||
Settings,
|
||||
StartBlock,
|
||||
Theme,
|
||||
} from '../models'
|
||||
|
||||
export const isTextStep = (step: Step): step is TextStep =>
|
||||
step.type === StepType.TEXT
|
||||
|
||||
export const isTextInputStep = (step: Step): step is TextInputStep =>
|
||||
step.type === StepType.TEXT_INPUT
|
||||
|
||||
export const parseNewTypebot = ({
|
||||
ownerId,
|
||||
folderId,
|
||||
name,
|
||||
}: {
|
||||
ownerId: string
|
||||
folderId: string | null
|
||||
name: string
|
||||
}): Prisma.TypebotUncheckedCreateInput => {
|
||||
const startBlock: StartBlock = {
|
||||
id: 'start-block',
|
||||
title: 'Start',
|
||||
graphCoordinates: { x: 0, y: 0 },
|
||||
steps: [
|
||||
{
|
||||
id: 'start-step',
|
||||
blockId: 'start-block',
|
||||
label: 'Form starts here',
|
||||
type: StepType.START,
|
||||
},
|
||||
],
|
||||
}
|
||||
const theme: Theme = {
|
||||
general: {
|
||||
font: 'Open Sans',
|
||||
background: { type: BackgroundType.NONE, content: '#ffffff' },
|
||||
},
|
||||
}
|
||||
const settings: Settings = {
|
||||
typingEmulation: {
|
||||
enabled: true,
|
||||
speed: 300,
|
||||
maxDelay: 1.5,
|
||||
},
|
||||
}
|
||||
return { folderId, name, ownerId, startBlock, theme, settings }
|
||||
}
|
||||
|
Reference in New Issue
Block a user