Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added Playwright test for 'RC sends circ bib requests to Vega' [SCC-5292](https://newyorkpubliclibrary.atlassian.net/browse/SCC-5292)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total nit but this case doesn't need to be in quotes, should follow pattern of other changelog entries ("Added Playwright test for redirecting circ bib requests to Vega")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

- Added author/contributor mode to browse landing [SCC-4966](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4966)
- Added author/contributor models and table [SCC-4969](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4969)
- Added author/contributor index and search results pages, with role handling [SCC-4967](https://newyorkpubliclibrary.atlassian.net/browse/SCC-4967)
Expand Down
12 changes: 12 additions & 0 deletions playwright/tests/redirects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ test("SHEP link with unknown uuid/path redirects to browse", async ({
await page.goto(`${BASE_URL}/subject_headings/something-something`)
await expect(page).toHaveURL(`${BASE_URL}/browse`)
})

test("RC sends circ bib requests to Vega", async ({ request }) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into a separate describe block– the other redirects in this test suite are set in middleware, which is different than this redirect which happens in the bib API route

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const response = await request.get(`${BASE_URL}/bib/b17782484`, {
maxRedirects: 0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the intention of this flag?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's there so Playwright doesn't follow the redirect, but just verifys the redirect response itself (status and location header)

})

expect(response.status()).toBeGreaterThanOrEqual(300)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should specifically be a 307, so we should test for that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

expect(response.status()).toBeLessThan(400)

const location = response.headers()["location"]
expect(location).toBe("https://borrow.nypl.org/search/card?recordId=17782484")
})
Loading