2
0

feat(dashboard): 🛂 Limit create folder to Pro user

This commit is contained in:
Baptiste Arnaud
2022-02-12 10:23:58 +01:00
parent b1f54b77c6
commit 3a7b9a0c63
14 changed files with 333 additions and 10 deletions

View File

@ -1,4 +1,5 @@
import test, { expect, Page } from '@playwright/test'
import path from 'path'
import { generate } from 'short-uuid'
import { createFolders, createTypebots } from '../services/database'
import { deleteButtonInConfirmDialog } from '../services/selectorUtils'
@ -72,6 +73,20 @@ test.describe('Dashboard page', () => {
await page.click('a:has-text("Back")')
await expect(typebotButton).toBeVisible()
})
test.describe('Free user', () => {
test.use({
storageState: path.join(__dirname, '../freeUser.json'),
})
test("create folder shouldn't be available", async ({ page }) => {
await page.goto('/typebots')
await page.click('text=Create a folder')
await expect(
page.locator('text="You can\'t create folders with the basic plan"')
).toBeVisible()
await expect(page.locator('text=Upgrade now')).toBeVisible()
})
})
})
const waitForNextApiCall = (page: Page, path?: string) =>