ci(e2e): 💚 Incomplete results
This commit is contained in:
@ -29,7 +29,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
typebotId,
|
||||
typebot: { ownerId: user.id },
|
||||
answers: { some: {} },
|
||||
isCompleted: isFreePlan(user),
|
||||
isCompleted: isFreePlan(user) ? false : undefined,
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
|
@ -98,13 +98,14 @@ export const createResults = async ({ typebotId }: { typebotId: string }) => {
|
||||
data: [
|
||||
...Array.from(Array(200)).map((_, idx) => {
|
||||
const today = new Date()
|
||||
const rand = Math.random()
|
||||
return {
|
||||
id: `result${idx}`,
|
||||
typebotId,
|
||||
createdAt: new Date(
|
||||
today.setTime(today.getTime() + 1000 * 60 * 60 * 24 * idx)
|
||||
),
|
||||
isCompleted: false,
|
||||
isCompleted: rand > 0.5,
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
@ -94,7 +94,7 @@ test.describe('Results page', () => {
|
||||
})
|
||||
test("Incomplete results shouldn't be displayed", async ({ page }) => {
|
||||
await page.goto(`/typebots/${typebotId}/results`)
|
||||
await page.click('text=Unlock 200 results')
|
||||
await page.click('text=Unlock')
|
||||
await expect(page.locator('text=Upgrade now')).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user