Skip to content

Commit

Permalink
Add test and changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Dec 18, 2024
1 parent c28b720 commit b6ce5b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated phone, email, notification preference and home library to be individually editable in Account Settings (SCC-4337, SCC-4254, SCC-4253)
- Updated username to be editable in My Account header (SCC-4236)

## Added

- Added email address field prepopulation on EDD Request form (SCC-4407)

## [1.3.6] 2024-11-6

## Added
Expand Down
18 changes: 17 additions & 1 deletion __test__/pages/hold/eddRequestPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("EDD Request page", () => {
status: 200,
})
;(getPatronData as jest.Mock).mockResolvedValue({
emails: ["[email protected]"],
patron: { emails: ["[email protected]"] },
})
;(fetchDeliveryLocations as jest.Mock).mockResolvedValue({
eddRequestable: true,
Expand Down Expand Up @@ -196,6 +196,22 @@ describe("EDD Request page", () => {
expect(screen.getByTestId("edd-request-form")).toBeInTheDocument()
})
})
describe("EDD Request prepopulated form fields", () => {
beforeEach(() => {
render(
<EDDRequestPage
discoveryBibResult={bibWithItems.resource}
discoveryItemResult={bibWithItems.resource.items[2]}
patronId="123"
patronEmail="[email protected]"
isAuthenticated={true}
/>
)
})
it("prepopulates the email field with the patron's email address if present", () => {
expect(screen.getByDisplayValue("[email protected]")).toBeInTheDocument()
})
})
describe("EDD Request form validation", () => {
beforeEach(async () => {
render(
Expand Down

0 comments on commit b6ce5b9

Please sign in to comment.