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