Skip to content

Commit

Permalink
Merge pull request #154 from NYPL/qa
Browse files Browse the repository at this point in the history
Merge qa into production
  • Loading branch information
dgcohen authored Mar 26, 2024
2 parents c7e1abf + 15f7a17 commit 6e30aa6
Show file tree
Hide file tree
Showing 55 changed files with 2,743 additions and 1,068 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ module.exports = {
format: ["camelCase", "PascalCase", "UPPER_CASE"],
},
],
"@typescript-eslint/ban-ts-comment": ["off"],
},
}
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prettier
npm run lint
npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run check-types
12 changes: 11 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.2] 2024-03-26

### Fixed

- Fixed Log Out link capitalization (SCC-4056)

### Updated

- Updated DS to v3.0 (SCC-4033)

## [1.0.1] 2024-03-06

### Fixes
### Fixed

- Fixed logout button not appearing on Advanced Search page (SCC-4028)

Expand Down
24 changes: 21 additions & 3 deletions __test__/fixtures/accountFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const mockCheckouts = [
isResearch: false,
bibId: "21678146",
isNyplOwned: true,
catalogHref: "https://nypl.na2.iiivega.com/search/card?recordId=21678146",
},
{
id: "65060570",
Expand All @@ -37,6 +38,7 @@ export const mockCheckouts = [
isResearch: false,
bibId: "17699134",
isNyplOwned: true,
catalogHref: "https://nypl.na2.iiivega.com/search/card?recordId=17699134",
},
]

Expand All @@ -45,15 +47,31 @@ export const mockHolds = [
patron: "2772226",
id: "48636910",
pickupByDate: "2024-02-15T09:00:00Z",
canFreeze: false,
canFreeze: true,
frozen: false,
status: "Requested item ready for pickup.",
pickupLocation: "SNFL (formerly Mid-Manhattan)",
pickupLocation: { code: "mal", name: "SNFL (formerly Mid-Manhattan)" },
title:
"Quit like a woman : the radical choice to not drink in a culture obsessed with alcohol",
isResearch: false,
bibId: "22002760",
isNyplOwned: false,
isNyplOwned: true,
catalogHref: "https://nypl.na2.iiivega.com/search/card?recordId=22002760",
},
{
patron: "2772226",
id: "48636911",
pickupByDate: "2024-02-15T09:00:00Z",
canFreeze: false,
frozen: false,
status: "Requested item ready for pickup.",
pickupLocation: { code: "mal", name: "SNFL (formerly Mid-Manhattan)" },
title:
"Quit like a woman : the radical choice to not drink in a culture obsessed with alcohol",
isResearch: false,
bibId: "22002761",
isNyplOwned: true,
catalogHref: "https://nypl.na2.iiivega.com/search/card?recordId=22002760",
},
]
export const mockFines = {
Expand Down
1 change: 1 addition & 0 deletions __test__/fixtures/searchResultsManyBibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8999,6 +8999,7 @@ export const results = {
}

export const emptyAggregationsResults = {
totalResults: 0,
itemListElement: [
{
"@type": "nypl:Aggregation",
Expand Down
7 changes: 4 additions & 3 deletions __test__/pages/search/searchResults.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ describe("Search Results page", () => {
mockRouter.push(`/search?q=${query}`)
render(<SearchResults isAuthenticated={true} results={{ results }} />)

const displayingText = screen.getByRole("heading", { level: 2 })
expect(displayingText).toHaveTextContent(
`Displaying 1-50 of ${results.totalResults} results for keyword "${query}"`
const displayingText = screen.getByText(
`Displaying 1-50 of ${results.totalResults} results for Keyword: "${query}"`
)
expect(displayingText).toBeInTheDocument()

const cards = screen.getAllByRole("heading", { level: 3 })
expect(cards).toHaveLength(50)
})
Expand Down
8 changes: 8 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ jest.mock("jose", () => ({

// Set NEXT_PUBLIC_APP_ENV to "development" for jest tests
process.env.NEXT_PUBLIC_APP_ENV = "development"

// Related to the useNYPLBreakpoints hook which is used in: ButtonGroup,
// FeedbackBox, Modal, MultiSelectGroup, and NewsletterSignup.
import { MatchMedia } from "@nypl/design-system-react-components"

new MatchMedia()

window.HTMLElement.prototype.scrollIntoView = jest.fn()
Loading

0 comments on commit 6e30aa6

Please sign in to comment.