Skip to content

Commit

Permalink
test: add test for About/Attributions (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelChen authored Nov 14, 2024
1 parent 7d88fe4 commit b028f44
Showing 1 changed file with 40 additions and 20 deletions.
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',
)
})
})

0 comments on commit b028f44

Please sign in to comment.