-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from NYPL/feature/DR-3100/connect-all-collect…
…ions-page-to-api DR-3100 connect all collections page to api
- Loading branch information
Showing
19 changed files
with
1,639 additions
and
455 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
Large diffs are not rendered by default.
Oops, something went wrong.
929 changes: 511 additions & 418 deletions
929
__tests__/__mocks__/data/mockPaginatedCollections.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
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,35 @@ | ||
import { render } from "@testing-library/react"; | ||
import { axe } from "jest-axe"; | ||
import React from "react"; | ||
import { mockCollectionsResponse } from "__tests__/__mocks__/data/mockApiResponses"; | ||
import { CollectionsPage } from "@/src/components/pages/collectionsPage/collectionsPage"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
jest.mock("next/navigation", () => ({ | ||
useRouter: jest.fn(), | ||
usePathname: jest.fn(), | ||
})); | ||
|
||
beforeEach(() => { | ||
(useRouter as jest.Mock).mockImplementation(() => ({ | ||
pathname: "/collections", | ||
})); | ||
}); | ||
|
||
describe.skip("Collections page Accessibility", () => { | ||
const searchParams = { | ||
collection_keywords: "flower", | ||
sort: "title-asc", | ||
page: "2", | ||
}; | ||
it("passes axe accessibility test", async () => { | ||
const { container } = render( | ||
<CollectionsPage | ||
data={mockCollectionsResponse} | ||
params={searchParams} | ||
renderCollections={true} | ||
/> | ||
); | ||
expect(await axe(container)).toHaveNoViolations(); | ||
}, 60000); | ||
}); |
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
Oops, something went wrong.