(theme) Support for image background

Closes #414
This commit is contained in:
Baptiste Arnaud
2023-03-22 14:45:10 +01:00
parent 1cf2195b4a
commit 3992227afc
6 changed files with 77 additions and 19 deletions

View File

@@ -7,6 +7,8 @@ const hostAvatarUrl =
'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1760&q=80'
const guestAvatarUrl =
'https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80'
const backgroundImageUrl =
'https://images.unsplash.com/photo-1508739773434-c26b3d09e071?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2940&q=80'
test.describe.parallel('Theme page', () => {
test.describe('General', () => {
@@ -38,6 +40,20 @@ test.describe.parallel('Theme page', () => {
'background-color',
'rgb(42, 157, 143)'
)
await page.click('text=Color')
await page.click('text="Image"')
await page.getByRole('button', { name: 'Select an image' }).click()
await page
.getByPlaceholder('Paste the image link...')
.fill(backgroundImageUrl)
await expect(
page.getByRole('img', { name: 'Background image' })
).toHaveAttribute('src', backgroundImageUrl)
await expect(page.locator('.typebot-container')).toHaveCSS(
'background-image',
`url("${backgroundImageUrl}")`
)
})
})