-
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.
[chores] updates package.json and tests
- Loading branch information
Showing
7 changed files
with
29 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import axios from "axios"; | ||
import { sendTestMail } from "../../src/utils/sentTestMail"; | ||
jest.mock("axios"); | ||
it("should send a test mail to the specified destination when called with a valid email", async () => { | ||
const mockResponse = { data: "success" }; | ||
(axios.post as jest.Mock).mockResolvedValue(mockResponse); | ||
|
||
const dest = "[email protected]"; | ||
const response = await sendTestMail(dest); | ||
|
||
expect(axios.post).toHaveBeenCalledWith("/manager.fcgi/confs//sendTestMail", { | ||
dest, | ||
}); | ||
expect(response).toEqual(mockResponse); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,5 @@ | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; | ||
import type { RootState, AppDispatch } from './store'; | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"; | ||
import type { AppDispatch, RootState } from "./store"; | ||
|
||
// Use throughout your app instead of plain `useDispatch` and `useSelector` | ||
export const useAppDispatch = () => useDispatch<AppDispatch>(); | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; |
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