2
0

💄 (buttons) Improve multiple choice form UI

This commit is contained in:
Baptiste Arnaud
2023-04-26 15:59:22 +02:00
parent f51d619c79
commit 124f350aa2
33 changed files with 454 additions and 262 deletions

View File

@@ -45,9 +45,8 @@ test.describe.parallel('Buttons input block', () => {
await expect(page.locator('text=Item 2')).toBeHidden()
await page.click('text=Preview')
const item3Button = page.locator('button >> text=Item 3')
await item3Button.click()
await expect(item3Button).toBeHidden()
await page.getByRole('button', { name: 'Item 3' }).click()
await expect(page.getByRole('button', { name: 'Item 3' })).toBeHidden()
await expect(page.getByTestId('guest-bubble')).toHaveText('Item 3')
await page.click('button[aria-label="Close"]')
@@ -67,8 +66,8 @@ test.describe.parallel('Buttons input block', () => {
await page.click('text=Preview')
await page.locator('button >> text="Item 3"').click()
await page.locator('button >> text="Item 1"').click()
await page.getByRole('checkbox', { name: 'Item 3' }).click()
await page.getByRole('checkbox', { name: 'Item 1' }).click()
await page.locator('text=Go').click()
await expect(page.locator('text="Item 3, Item 1"')).toBeVisible()

View File

@@ -18,7 +18,7 @@ test.describe.parallel('Theme page', () => {
id: typebotId,
})
await page.goto(`/typebots/${typebotId}/theme`)
await expect(page.locator('button >> text="Go"')).toBeVisible()
await expect(page.getByRole('button', { name: 'Go' })).toBeVisible()
// Font
await page.getByRole('button', { name: 'Font & Background' }).click()
@@ -70,7 +70,7 @@ test.describe.parallel('Theme page', () => {
}
await page.goto(`/typebots/${typebotId}/theme`)
await expect(page.locator('button >> text="Go"')).toBeVisible()
await expect(page.getByRole('button', { name: 'Go' })).toBeVisible()
await page.click('button:has-text("Chat")')
// Host avatar
@@ -81,7 +81,7 @@ test.describe.parallel('Theme page', () => {
'input[placeholder="Paste the image link..."]',
hostAvatarUrl
)
await page.locator('button >> text="Go"').click()
await page.getByRole('button', { name: 'Go' }).click()
await expect(page.locator('.typebot-container img')).toHaveAttribute(
'src',
@@ -155,7 +155,7 @@ test.describe.parallel('Theme page', () => {
'[data-testid="guest-bubbles-theme"] >> [aria-label="Pick a color"] >> nth=1'
)
await page.fill('input[value="#FFFFFF"]', '#264653')
await page.locator('button >> text="Go"').click()
await page.getByRole('button', { name: 'Go' }).click()
const guestBubble = page.locator('[data-testid="guest-bubble"] >> nth=-1')
await expect(guestBubble).toHaveCSS(
'background-color',
@@ -173,7 +173,7 @@ test.describe.parallel('Theme page', () => {
await page
.locator('input[placeholder="Paste the image link..."]')
.fill(guestAvatarUrl)
await page.locator('button >> text="Go"').click()
await page.getByRole('button', { name: 'Go' }).click()
await expect(page.locator('.typebot-container img')).toHaveAttribute(
'src',
guestAvatarUrl
@@ -202,7 +202,7 @@ test.describe.parallel('Theme page', () => {
id: typebotId,
})
await page.goto(`/typebots/${typebotId}/theme`)
await expect(page.locator('button >> text="Go"')).toBeVisible()
await expect(page.getByRole('button', { name: 'Go' })).toBeVisible()
await page.click('button:has-text("Custom CSS")')
await page.fill(
'div[role="textbox"]',
@@ -222,7 +222,7 @@ test.describe.parallel('Theme page', () => {
id: typebotId,
})
await page.goto(`/typebots/${typebotId}/theme`)
await expect(page.locator('button >> text="Go"')).toBeVisible()
await expect(page.getByRole('button', { name: 'Go' })).toBeVisible()
await page.getByRole('button', { name: 'Templates New!' }).click()
await page.getByRole('button', { name: 'Save current theme' }).click()
await page.getByPlaceholder('My template').fill('My awesome theme')

View File

@@ -14,7 +14,7 @@ test('Big groups should work as expected', async ({ page }) => {
await page.locator('input').press('Enter')
await page.locator('input').fill('26')
await page.locator('input').press('Enter')
await page.locator('button >> text=Yes').click()
await page.getByRole('button', { name: 'Yes' }).click()
await page.goto(`${process.env.NEXTAUTH_URL}/typebots/${typebotId}/results`)
await expect(page.locator('text="Baptiste"')).toBeVisible()
await expect(page.locator('text="26"')).toBeVisible()