-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7733260
commit 9985b42
Showing
26 changed files
with
427 additions
and
584 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
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
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
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 |
---|---|---|
|
@@ -3,10 +3,12 @@ import { shallow } from "enzyme"; | |
import { act, render, fireEvent } from "@testing-library/react"; | ||
import { LocalLogins } from "./LocalLogins"; | ||
|
||
const mockPost = jest.fn(); | ||
const localLogins = <LocalLogins />; | ||
const mockLoginUser = jest.fn(); | ||
jest.mock("../../../util/apiLib", () => ({ | ||
loginUser: (username, password) => mockLoginUser(username, password), | ||
jest.mock("aws-amplify", () => ({ | ||
Auth: { | ||
signIn: (email, password) => mockPost(email, password), | ||
}, | ||
})); | ||
const mockHistoryPush = jest.fn(); | ||
jest.mock("react-router-dom", () => ({ | ||
|
@@ -36,10 +38,7 @@ describe("LocalLogin component", () => { | |
await act(async () => { | ||
fireEvent.click(generateButton); | ||
}); | ||
expect(mockLoginUser).toHaveBeenCalledWith( | ||
"[email protected]", | ||
"superS3cure" // pragma: allowlist secret | ||
); | ||
expect(mockPost).toHaveBeenCalledWith("[email protected]", "superS3cure"); | ||
expect(mockHistoryPush).toHaveBeenCalledWith("/"); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./useUser"; | ||
export * from "./userProvider"; | ||
export * from "./requestOptions"; | ||
export * from "./authLifecycle"; |
Oops, something went wrong.