CFE-3 add handler (write a mock) for provinceList and RoleList and add their hooks and write rendering test for CreateContent component
This commit is contained in:
@@ -1,10 +1,42 @@
|
||||
import {GET_USER_ROUTE} from "@/core/data/apiRoutes";
|
||||
import {GET_PROVINCE_LIST, GET_ROLE_LIST, GET_USER_ROUTE} from "@/core/data/apiRoutes";
|
||||
import {rest} from "msw";
|
||||
|
||||
export const handler = [rest.get(GET_USER_ROUTE, (req, res, ctx) => {
|
||||
return res(ctx.json({
|
||||
data: {
|
||||
id: 10
|
||||
}
|
||||
}))
|
||||
})]
|
||||
export const handler = [
|
||||
rest.get(GET_USER_ROUTE, (req, res, ctx) => {
|
||||
return res(ctx.json({
|
||||
data: {
|
||||
id: 10
|
||||
}
|
||||
}))
|
||||
}),
|
||||
rest.get(GET_PROVINCE_LIST, (req, res, ctx) => {
|
||||
return res(ctx.json({
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
name: "آذربایجان شرقی"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "اردبیل"
|
||||
}
|
||||
]
|
||||
}))
|
||||
}),
|
||||
rest.get(GET_ROLE_LIST, (req, res, ctx) => {
|
||||
return res(ctx.json({
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
name: "passenger_office_chief",
|
||||
name_fa: "رئیس اداره مسافری استان"
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "province_manager",
|
||||
name_fa: "مدیر کل استانی"
|
||||
}
|
||||
]
|
||||
}))
|
||||
})
|
||||
]
|
||||
Reference in New Issue
Block a user