From c80089f0a51534a70955487b17a0ebeba1258615 Mon Sep 17 00:00:00 2001 From: Yael Chen <51058584+YaelChen@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:24:47 +0200 Subject: [PATCH] test: fix test for 'about' YouTube modal (#1003) --- tests/about.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/about.spec.ts b/tests/about.spec.ts index a39a90aa..6c0a95f5 100644 --- a/tests/about.spec.ts +++ b/tests/about.spec.ts @@ -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() @@ -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', + ) + }) })