Skip to content

Commit

Permalink
Revert how the mocked cookie value was read
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinGuzman committed Apr 23, 2024
1 parent 21c40a8 commit a2c86c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Header/utils/encoreCatalogLogOutTimer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ describe("EncoreCatalogLogOutTimer", () => {
// The "PAT_LOGGED_IN" cookie does not exist.
.mockReturnValueOnce(null)
// The "nyplIdentityPatron" cookie mock value.
.mockReturnValueOnce({ nyplIdentityPatron: "someIdentityValue" })
.mockReturnValueOnce("someIdentityValue")
// The "VALID_DOMAIN_LAST_VISITED" cookie mock value.
.mockReturnValueOnce({ VALID_DOMAIN_LAST_VISITED: 1000 });
.mockReturnValueOnce(1000);
const cookiesRemove = jest.spyOn(Cookies, "remove");

// Start the timer on a valid domain.
Expand Down Expand Up @@ -75,9 +75,9 @@ describe("EncoreCatalogLogOutTimer", () => {
.mockReturnValueOnce(null)
.mockReturnValueOnce(null)
// The "nyplIdentityPatron" cookie mock value.
.mockReturnValueOnce({ nyplIdentityPatron: "someIdentityValue" })
.mockReturnValueOnce("someIdentityValue")
// The "VALID_DOMAIN_LAST_VISITED" cookie mock value.
.mockReturnValueOnce({ VALID_DOMAIN_LAST_VISITED: 1000 });
.mockReturnValueOnce(1000);
const cookiesRemove = jest.spyOn(Cookies, "remove");
const logOutFromEncoreAndCatalogIn = jest.spyOn(
encoreCatalogLogOutTimer,
Expand Down Expand Up @@ -199,7 +199,7 @@ describe("EncoreCatalogLogOutTimer", () => {
.mockReturnValueOnce("loggedIn!")
// The "VALID_DOMAIN_LAST_VISITED" cookie mock value.
// This gets called twice.
.mockReturnValue(mockedLastVisitTime.toString());
.mockReturnValue(mockedLastVisitTime);
const cookiesSet = jest.spyOn(Cookies, "set");
const logOutFromEncoreAndCatalogIn = jest.spyOn(
encoreCatalogLogOutTimer,
Expand Down Expand Up @@ -289,7 +289,7 @@ describe("EncoreCatalogLogOutTimer", () => {
.mockReturnValueOnce("loggedIn!")
.mockReturnValueOnce("loggedIn!")
// The "VALID_DOMAIN_LAST_VISITED" cookie mock value.
.mockReturnValue(mockLastVisitedTime.toString());
.mockReturnValue(mockLastVisitedTime);
const cookiesRemove = jest.spyOn(Cookies, "remove");
const logOutFromEncoreAndCatalogIn = jest.spyOn(
encoreCatalogLogOutTimer,
Expand Down

0 comments on commit a2c86c4

Please sign in to comment.