Skip to content

Commit

Permalink
test: fix test for 'about' YouTube modal (#1003)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelChen authored Jan 13, 2025
1 parent 6a37701 commit c80089f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ test.describe('About Page Tests', () => {
const locator = page.locator('li').filter({ hasText: 'אודות' })
await expect(locator).toHaveClass(/menu-item-selected/)
})

test('page title should be `מהו אתר “דאטאבוס”?`', async ({ page }) => {
await page.goto('/about')
await expect(page.getByRole('heading', { name: 'מהו אתר “דאטאבוס”?' })).toBeVisible()
})

test('clicking dontaions link should lead to "sadna" site', async ({ page }) => {
await page.goto('/about')
await page.getByRole('link', { name: 'תרומות קטנות נוספות' }).click()
Expand Down Expand Up @@ -104,4 +106,15 @@ test.describe('About Page Tests', () => {
'https://github.com/hasadna/open-bus-map-search/blob/main/CONTRIBUTING.md',
)
})

test('the YouTube modal in "about" is visible and have the correct src', async ({ page }) => {
await page.goto('/about')
const iframeElement = await page.waitForSelector('iframe')
expect(iframeElement.isVisible())
const videoSrc = page.locator('iframe')
await expect(videoSrc).toHaveAttribute(
'src',
'https://www.youtube.com/embed/videoseries?si=oTULlxq8Is188hPu&list=PL6Rh06rT7uiX1AQE-lm55hy-seL3idx3T',
)
})
})

0 comments on commit c80089f

Please sign in to comment.