Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test for About/Attributions #918

Merged
merged 5 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 40 additions & 20 deletions tests/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,45 @@ test.describe('About Page Tests', () => {
await page.getByRole('link', { name: 'Creative Commons' }).click()
await expect(page).toHaveURL('https://creativecommons.org/')
})
})

test('clicking the links under "questions" should lead to the correct contact ways', async ({
page,
}) => {
await page.goto('/')
await page.getByRole('link', { name: 'אודות' }).click()
await page.getByRole('link', { name: 'צרו איתנו קשר' }).click()
await expect(page).toHaveURL('https://www.hasadna.org.il/צור-קשר/')
await page.goto('/about')
await page.getByRole('link', { name: 'דברו איתנו על זה בסלאק' }).click()
await expect(page).toHaveURL(
'https://hasadna.slack.com/join/shared_invite/zt-167h764cg-J18ZcY1odoitq978IyMMig#/shared-invite/email',
)
await page.goto('/about')
await page
.getByRole('link', { name: 'שרתים עולים כסף - עזרו לנו להמשיך לתחזק ולפתח את הפרויקט!' })
.click()
await expect(page).toHaveURL(
'https://www.jgive.com/new/he/ils/donation-targets/3268#donation-modal',
)
test('clicking the links under "questions" should lead to the correct contact ways', async ({
page,
}) => {
await page.goto('/')
await page.getByRole('link', { name: 'אודות' }).click()
await page.getByRole('link', { name: 'צרו איתנו קשר' }).click()
await expect(page).toHaveURL('https://www.hasadna.org.il/צור-קשר/')
await page.goto('/about')
await page.getByRole('link', { name: 'דברו איתנו על זה בסלאק' }).click()
await expect(page).toHaveURL(
'https://hasadna.slack.com/join/shared_invite/zt-167h764cg-J18ZcY1odoitq978IyMMig#/shared-invite/email',
)
await page.goto('/about')
await page
.getByRole('link', { name: 'שרתים עולים כסף - עזרו לנו להמשיך לתחזק ולפתח את הפרויקט!' })
.click()
await expect(page).toHaveURL(
'https://www.jgive.com/new/he/ils/donation-targets/3268#donation-modal',
)
})

test('links under "Attributions" should lead to the attr origins', async ({ page }) => {
await page.goto('/')
await page.getByRole('link', { name: 'אודות' }).click()
await page.getByRole('link', { name: 'Applitools' }).click()
await expect(page).toHaveURL('https://applitools.com/')
await page.goto('/about')
const page1Promise = page.waitForEvent('popup')
await page.getByRole('link', { name: 'pch.vector' }).click()
const page1 = await page1Promise
await expect(page1).toHaveURL(
'https://www.freepik.com/free-vector/passengers-waiting-bus-city-queue-town-road-flat-vector-illustration-public-transport-urban-lifestyle_10173277.htm#query=public%20transportation&position=0&from_view=search&track=ais&uuid=70a79b38-20cb-42b8-9dde-b96a68088522',
)
await page.goto('https://github.com/hasadna/open-bus-map-search/blob/main/CONTRIBUTING.md')
await page.goto('/about')
await page.getByRole('link', { name: 'קרא כאן' }).click()
await expect(page).toHaveURL(
'https://github.com/hasadna/open-bus-map-search/blob/main/CONTRIBUTING.md',
)
})
})
Loading