2
0

fix(giphy): search

This commit is contained in:
Baptiste Arnaud
2022-08-12 08:34:53 +02:00
parent 6716cf2484
commit 5333ba9088
7 changed files with 87 additions and 85 deletions

View File

@ -83,7 +83,23 @@ test.describe.parallel('Image bubble block', () => {
await page.click('text=Click to edit...')
await page.click('text=Giphy')
await page.click('img >> nth=3', {
const firstGiphyImage = page.locator('.giphy-gif-img >> nth=0')
await expect(firstGiphyImage).toHaveAttribute(
'src',
new RegExp('giphy.com/media', 'gm')
)
const trendingfirstImageSrc = await firstGiphyImage.getAttribute('src')
expect(trendingfirstImageSrc).toMatch(new RegExp('giphy.com/media', 'gm'))
await page.fill('[placeholder="Search..."]', 'fun')
await page.waitForTimeout(500)
await expect(firstGiphyImage).toHaveAttribute(
'src',
new RegExp('giphy.com/media', 'gm')
)
const funFirstImageSrc = await firstGiphyImage.getAttribute('src')
expect(funFirstImageSrc).toMatch(new RegExp('giphy.com/media', 'gm'))
expect(trendingfirstImageSrc).not.toBe(funFirstImageSrc)
await firstGiphyImage.click({
force: true,
position: { x: 0, y: 0 },
})