Skip to content

Commit

Permalink
ci(e2e): 💚 Incomplete results
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 14, 2022
1 parent 714f7c8 commit e6f6e25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/builder/pages/api/typebots/[typebotId]/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion apps/builder/playwright/services/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}),
],
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/playwright/tests/results.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
Expand Down

3 comments on commit e6f6e25

@vercel
Copy link

@vercel vercel bot commented on e6f6e25 Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
next.typebot.io
builder-v2-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e6f6e25 Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

viewer-v2-git-main-typebot-io.vercel.app
viewer-v2-typebot-io.vercel.app
typebot-viewer.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e6f6e25 Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

landing-page-v2 – ./apps/landing-page

landing-page-v2-jade.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
landing-page-v2-typebot-io.vercel.app

Please sign in to comment.