2
0

feat(results): 🛂 Limit incomplete submissions

This commit is contained in:
Baptiste Arnaud
2022-02-12 12:54:16 +01:00
parent 3a7b9a0c63
commit ec470b578c
11 changed files with 93 additions and 32 deletions

View File

@ -2,6 +2,7 @@ import test, { expect, Page } from '@playwright/test'
import { readFileSync } from 'fs'
import { defaultTextInputOptions, InputStepType } from 'models'
import { parse } from 'papaparse'
import path from 'path'
import { generate } from 'short-uuid'
import {
createResults,
@ -86,6 +87,17 @@ test.describe('Results page', () => {
const { data: dataAll } = parse(fileAll)
validateExportAll(dataAll)
})
test.describe('Free user', () => {
test.use({
storageState: path.join(__dirname, '../freeUser.json'),
})
test("Incomplete results shouldn't be displayed", async ({ page }) => {
await page.goto(`/typebots/${typebotId}/results`)
await page.click('text=Unlock 200 results')
await expect(page.locator('text=Upgrade now')).toBeVisible()
})
})
})
const validateExportSelection = (data: unknown[]) => {