-
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 #422 from NYPL/SCC-4407/edd-form-autopopulate-patr…
…on-email SCC-4407 - EDD Form Prepopulate Patron Email
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 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
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ jest.mock("../../../src/server/auth") | |
jest.mock("../../../src/server/api/bib") | ||
jest.mock("../../../src/server/sierraClient") | ||
jest.mock("../../../src/server/api/hold") | ||
jest.mock("../../../src/models/MyAccount") | ||
|
||
jest.mock("next/router", () => jest.requireActual("next-router-mock")) | ||
|
||
|
@@ -205,6 +206,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( | ||
|
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