CFE-3 making directories and making test file for expert management and write first test
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
import {render, screen} from "@testing-library/react";
|
||||||
|
import MockAppWithProviders from "../../../../../../mocks/AppWithProvider";
|
||||||
|
import ExpertManagementDataTable from "@/components/dashboard/expert-management/DataTable";
|
||||||
|
|
||||||
|
describe("Expert Management Component From Expert Management", () => {
|
||||||
|
describe("Rendering", () => {
|
||||||
|
it("Table Headers Rendered", () => {
|
||||||
|
render(<MockAppWithProviders><ExpertManagementDataTable/></MockAppWithProviders>);
|
||||||
|
const idHeader = screen.queryByText(/کد یکتا/i);
|
||||||
|
const nameHeader = screen.queryByText(/نام/i);
|
||||||
|
const usernameHeader = screen.queryByText(/نام کاربری/i);
|
||||||
|
const emailHeader = screen.queryByText(/پست الکترونیک/i);
|
||||||
|
const phone_numberHeader = screen.queryByText(/شماره همراه/i);
|
||||||
|
const national_idHeader = screen.queryByText(/کد ملی/i);
|
||||||
|
const positionHeader = screen.queryByText(/سمت/i);
|
||||||
|
const province_nameHeader = screen.queryByText(/استان/i);
|
||||||
|
const city_nameHeader = screen.queryByText(/شهر/i);
|
||||||
|
const role_nameHeader = screen.queryByText(/نقش/i);
|
||||||
|
const updated_atHeader = screen.queryByText(/آخرین بروزرسانی/i);
|
||||||
|
expect(idHeader).toBeInTheDocument();
|
||||||
|
expect(nameHeader).toBeInTheDocument();
|
||||||
|
expect(usernameHeader).toBeInTheDocument();
|
||||||
|
expect(emailHeader).toBeInTheDocument();
|
||||||
|
expect(phone_numberHeader).toBeInTheDocument();
|
||||||
|
expect(national_idHeader).toBeInTheDocument();
|
||||||
|
expect(positionHeader).toBeInTheDocument();
|
||||||
|
expect(province_nameHeader).toBeInTheDocument();
|
||||||
|
expect(city_nameHeader).toBeInTheDocument();
|
||||||
|
expect(role_nameHeader).toBeInTheDocument();
|
||||||
|
expect(updated_atHeader).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe("Behavioral", () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
describe("Validation", () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
function ExpertManagementDataTable() {
|
||||||
|
return (
|
||||||
|
<p>asdads</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ExpertManagementDataTable;
|
||||||
12
src/components/dashboard/expert-management/index.jsx
Normal file
12
src/components/dashboard/expert-management/index.jsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import DashboardLayouts from "@/layouts/dashboardLayouts";
|
||||||
|
import ExpertManagementDataTable from "@/components/dashboard/expert-management/DataTable";
|
||||||
|
|
||||||
|
function DashboardExpertManagementComponent() {
|
||||||
|
return (
|
||||||
|
<DashboardLayouts>
|
||||||
|
<ExpertManagementDataTable/>
|
||||||
|
</DashboardLayouts>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DashboardExpertManagementComponent;
|
||||||
23
src/pages/dashboard/expert-management/index.jsx
Normal file
23
src/pages/dashboard/expert-management/index.jsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||||
|
import {parse} from "next-useragent";
|
||||||
|
import DashboardExpertManagementComponent from "@/components/dashboard/expert-management";
|
||||||
|
|
||||||
|
export default function ExpertManagement() {
|
||||||
|
return (
|
||||||
|
<WithAuthMiddleware>
|
||||||
|
<DashboardExpertManagementComponent/>
|
||||||
|
</WithAuthMiddleware>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getServerSideProps({req, locale}) {
|
||||||
|
const {isBot} = parse(req.headers["user-agent"]);
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||||
|
title: "Dashboard.expert_management",
|
||||||
|
isBot,
|
||||||
|
locale
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user