-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into staff-restricted
- Loading branch information
Showing
21 changed files
with
2,575 additions
and
3,872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
import { gotoWithoutCache, requiredCookies } from './helpers/contexts'; | ||
import { baseUrl } from './helpers/utils'; | ||
|
||
test.describe('Server-side redirection logic works as expected', () => { | ||
test('/pages/ route redirects to relevant URL', async ({ context, page }) => { | ||
await context.addCookies(requiredCookies); | ||
|
||
// Visit Us site section | ||
await gotoWithoutCache(`${baseUrl}/pages/accessibility`, page); | ||
await expect(page.url()).toEqual(`${baseUrl}/visit-us/accessibility`); | ||
|
||
// Orphan page | ||
await gotoWithoutCache(`${baseUrl}/pages/contact-us`, page); | ||
await expect(page.url()).toEqual(`${baseUrl}/contact-us`); | ||
}); | ||
|
||
test("Landing pages don't have a parent route", async ({ context, page }) => { | ||
await context.addCookies(requiredCookies); | ||
|
||
await gotoWithoutCache(`${baseUrl}/visit-us/visit-us`, page); | ||
await expect( | ||
page | ||
.getByRole('heading') | ||
.getByText('Not the Wellcome you were expecting?') | ||
).toBeVisible(); | ||
|
||
await gotoWithoutCache(`${baseUrl}/pages/visit-us`, page); | ||
await expect(page.url()).toEqual(`${baseUrl}/visit-us`); | ||
}); | ||
}); | ||
|
||
// As they are displayed through a hack, we want to make sure they're working | ||
// https://github.com/wellcomecollection/wellcomecollection.org/pull/10890 | ||
test('Cookie policy tables are showing', async ({ context, page }) => { | ||
await context.addCookies(requiredCookies); | ||
await gotoWithoutCache(`${baseUrl}/about-us/cookie-policy`, page); | ||
|
||
await expect(page.getByRole('table')).toHaveCount(3); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.