Skip to content

Commit

Permalink
[chores] updates package.json and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eriikah committed Aug 22, 2024
1 parent 36653e1 commit 9964bf6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 38 deletions.
5 changes: 5 additions & 0 deletions __test__/AuthParam.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ describe("AuthParam Dashboard", () => {
changeRadio(6);
changeRadio(7);
changeRadio(8);
fireEvent.click(screen.getByText("Kerberos"));
changeRadio(0);
changeRadio(1);
changeInput(0, "test1");
changeInput(1, "test2");
changeSelect("Active Directory + Kerberos", 0, "LDAP");
expect(screen.getByText("LDAP parameters")).toBeDefined();
changeInput(0, "test1");
Expand Down
15 changes: 15 additions & 0 deletions __test__/utils/sendTestMail.test.ts
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);
});
34 changes: 3 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/react-dom": "^18.2.24",
"@types/react-router-dom": "^5.3.3",
"@types/react-router-redux": "^5.0.27",
"axios": "^1.6.8",
"axios": "^1.7.4",
"i18next": "^23.10.1",
"i18next-browser-languagedetector": "^7.2.1",
"i18next-http-backend": "^2.5.0",
Expand Down
5 changes: 2 additions & 3 deletions src/app/hooks.ts
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;
5 changes: 3 additions & 2 deletions src/components/managerComponents/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ function AppCard({
className={`card ${
(!issuer && !(type === "native")) || !rule ? "issue" : ""
}${maintenanceToggled ? "Maintenance" : ""}`}
data-testid="appcard"
data-testid={info.name}
role="gridcell"
onClick={() => dispatch(push(`#app/${type}/${info.name}`))}
>
<div data-testid={info.name}>
<div data-testid="appcard">
<div>
<strong className="title2">
{info.name} <span> {!rule ? "⚠️" : ""}</span>
Expand Down
1 change: 0 additions & 1 deletion src/dashboards/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export default function TreeRender({
return (
<div className="treePage">
<div className="tree" ref={ref}>
{width} {height}
<Tree
disableDrag={true}
rowHeight={height / 25}
Expand Down

0 comments on commit 9964bf6

Please sign in to comment.