Skip to content

Commit

Permalink
Merge branch 'mvp-2.1.0' into CRDCDH-956
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega authored Mar 15, 2024
2 parents d3d4434 + bd08f3e commit de24b8f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/Contexts/AuthContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ describe("AuthContext > AuthProvider Tests", () => {

const screen = render(<TestParent mocks={mocks} />);

await waitFor(() => expect(screen.getByTestId("first-name").textContent).toEqual("The API updated my first name"));

const cachedUser = JSON.parse(localStorage.getItem("userDetails"));
expect(cachedUser.firstName).toEqual("The API updated my first name");
await waitFor(() => expect(screen.getByTestId("first-name").textContent).toEqual(mocks[0].result.data.getMyUser.firstName));
await waitFor(() => {
const cachedUser = JSON.parse(localStorage.getItem("userDetails"));
expect(cachedUser.firstName).toEqual(mocks[0].result.data.getMyUser.firstName);
}, { timeout: 1000 });
});

it("should logout the user if the BE API call fails", async () => {
Expand Down

0 comments on commit de24b8f

Please sign in to comment.