Skip to content

Commit

Permalink
Merge pull request #340 from NYPL/development
Browse files Browse the repository at this point in the history
Release 0.14.0 to production
  • Loading branch information
jackiequach authored Jul 21, 2022
2 parents afa4bf8 + 38f5643 commit 3bf0eb0
Show file tree
Hide file tree
Showing 67 changed files with 10,608 additions and 7,900 deletions.
11 changes: 0 additions & 11 deletions .tugboat/config.yml

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# CHANGE LOG
## [0.14.0]
- Upgrade to NYPL Design System version 1.0.0
- Decouples search query into separate states for each individual form field
- Updates unit tests and snapshots
- CHORE: removes tugboat deploy
- Change format filters to "Readable", "Downloadable", and "Requestable"
- Upgrade to Web Reader version 3.1.0
- Adds author and work title to edition detail page
- Adds feature flag functionality

## [0.13.1]
- Added "Back to search results" link for works and editions

Expand Down
14,154 changes: 8,259 additions & 5,895 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sfr-bookfinder-front-end",
"version": "0.13.1",
"version": "0.14.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -13,15 +13,20 @@
"lint:fix": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix --ignore-path .gitignore"
},
"dependencies": {
"@nypl/design-system-react-components": "~0.21.2",
"@chakra-ui/react": "^1.8.8",
"@chakra-ui/system": "^2.1.1",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@nypl/design-system-react-components": "^1.0.0",
"@nypl/dgx-header-component": "git+https://[email protected]/NYPL/dgx-header-component#reactupdate",
"@nypl/dgx-react-footer": "0.5.8",
"@nypl/web-reader": "^1.0.0",
"@nypl/web-reader": "^3.1.0",
"@types/node": "^16.11.6",
"@types/react": "^16.9.5",
"css-loader": "^6.5.0",
"extract-loader": "^5.1.0",
"focus-trap-react": "^8.8.2",
"framer-motion": "^6.2.10",
"next": "^10.2.0",
"next-absolute-url": "^1.2.2",
"next-transpile-modules": "^7.0.0",
Expand All @@ -35,6 +40,7 @@
},
"devDependencies": {
"@axe-core/react": "^4.1.1",
"@emotion/jest": "^11.9.3",
"@testing-library/dom": "^8.10.1",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
Expand Down
22 changes: 12 additions & 10 deletions src/__tests__/AdvancedSearch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("renders advanced search correctly", () => {
});

describe("Advanced Search submit", () => {
test("Submits well formed query", () => {
test("Submits well formed query", async () => {
render(<AdvancedSearch languages={defaultLanguages} />);

const inputValues = {
Expand All @@ -67,25 +67,26 @@ describe("Advanced Search submit", () => {
Subject: "poetry",
Title: "Handbook",
};

fireEvent.click(screen.getByRole("button", { name: "Filter Languages" }));
userEvent.click(await screen.findByRole("checkbox", { name: "english" }));
inputTerms.forEach((val) => {
fireEvent.change(screen.getByLabelText(val.label), {
target: { value: inputValues[val.label] },
});
});

userEvent.click(screen.getByRole("checkbox", { name: "english" }));
fireEvent.change(screen.getByRole("spinbutton", { name: "From" }), {
target: { value: "1990" },
});
fireEvent.change(screen.getByRole("spinbutton", { name: "To" }), {
target: { value: "1999" },
});
userEvent.click(screen.getByRole("checkbox", { name: "PDF" }));
userEvent.click(screen.getByRole("checkbox", { name: "Readable" }));

userEvent.click(screen.getByRole("button", { name: "Search" }));

const expectedQuery = {
filter: "language:english,startYear:1990,endYear:1999,format:pdf",
filter: "language:english,startYear:1990,endYear:1999,format:readable",
query: "keyword:cat,author:Nook,title:Handbook,subject:poetry",
};
expect(mockRouter).toMatchObject({
Expand Down Expand Up @@ -175,25 +176,26 @@ describe("Advanced Search clear", () => {
Subject: "poetry",
Title: "Handbook",
};

fireEvent.click(screen.getByRole("button", { name: "Filter Languages" }));
userEvent.click(screen.getByRole("checkbox", { name: "english" }));
inputTerms.forEach((val) => {
fireEvent.change(screen.getByLabelText(val.label), {
target: { value: inputValues[val.label] },
});
});

userEvent.click(screen.getByRole("checkbox", { name: "english" }));
fireEvent.change(screen.getByRole("spinbutton", { name: "From" }), {
target: { value: "1990" },
});
fireEvent.change(screen.getByRole("spinbutton", { name: "To" }), {
target: { value: "1999" },
});
userEvent.click(screen.getByRole("checkbox", { name: "PDF" }));
userEvent.click(screen.getByRole("checkbox", { name: "Readable" }));

expect(screen.getByLabelText("english")).toBeChecked();
expect(screen.getByLabelText("From")).toHaveValue(1990);
expect(screen.getByLabelText("To")).toHaveValue(1999);
expect(screen.getByLabelText("PDF")).toBeChecked();
expect(screen.getByLabelText("Readable")).toBeChecked();

inputTerms.forEach((val) => {
expect(screen.getByLabelText(val.label)).toHaveValue(
Expand All @@ -206,7 +208,7 @@ describe("Advanced Search clear", () => {
expect(screen.getByLabelText("english")).not.toBeChecked();
expect(screen.getByLabelText("From")).toHaveValue(null);
expect(screen.getByLabelText("To")).toHaveValue(null);
expect(screen.getByLabelText("PDF")).not.toBeChecked();
expect(screen.getByLabelText("Readable")).not.toBeChecked();

inputTerms.forEach((val) => {
expect(screen.getByLabelText(val.label)).toHaveValue("");
Expand Down
Loading

0 comments on commit 3bf0eb0

Please sign in to comment.