2
0

refactor: ♻️ Migrate from short-uuid to cuid lib

This commit is contained in:
Baptiste Arnaud
2022-03-18 12:30:42 +01:00
parent 64bafd15a1
commit 1423c14547
47 changed files with 120 additions and 132 deletions

View File

@ -2,10 +2,10 @@ import test, { expect } from '@playwright/test'
import path from 'path'
import { importTypebotInDatabase } from '../services/database'
import { typebotViewer } from '../services/selectorUtils'
import { generate } from 'short-uuid'
import cuid from 'cuid'
test('should work as expected', async ({ page }) => {
const typebotId = generate()
const typebotId = cuid()
await importTypebotInDatabase(
path.join(__dirname, '../fixtures/typebots/hugeBlock.json'),
{ id: typebotId, publicId: `${typebotId}-public` }

View File

@ -1,6 +1,5 @@
import test, { expect } from '@playwright/test'
import { createTypebots, parseDefaultBlockWithStep } from '../services/database'
import { generate } from 'short-uuid'
import {
defaultSettings,
defaultTextInputOptions,
@ -8,9 +7,10 @@ import {
Metadata,
} from 'models'
import { typebotViewer } from '../services/selectorUtils'
import cuid from 'cuid'
test('Should correctly parse metadata', async ({ page }) => {
const typebotId = generate()
const typebotId = cuid()
const customMetadata: Metadata = {
description: 'My custom description',
title: 'Custom title',

View File

@ -1,10 +1,10 @@
import test, { expect } from '@playwright/test'
import { createTypebots, parseDefaultBlockWithStep } from '../services/database'
import { generate } from 'short-uuid'
import cuid from 'cuid'
import { defaultSettings, defaultTextInputOptions, InputStepType } from 'models'
test('Result should be in storage by default', async ({ page }) => {
const typebotId = generate()
const typebotId = cuid()
await createTypebots([
{
id: typebotId,
@ -28,7 +28,7 @@ test('Result should be in storage by default', async ({ page }) => {
test.describe('Create result on page refresh enabled', () => {
test('should work', async ({ page }) => {
const typebotId = generate()
const typebotId = cuid()
await createTypebots([
{
id: typebotId,