feat: unify Person and User creation form with conditional password
This commit is contained in:
@@ -3,7 +3,6 @@ import { renderToStaticMarkup } from "react-dom/server"
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest"
|
||||
|
||||
import { en } from "@/i18n/dictionaries/en"
|
||||
import { es } from "@/i18n/dictionaries/es"
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
getI18n: vi.fn(),
|
||||
@@ -33,23 +32,6 @@ describe("person form schema wiring", () => {
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
it("passes server-resolved Person schema copy into the new person form boundary", async () => {
|
||||
mocks.getI18n.mockResolvedValue({ dictionary: es, locale: "es" })
|
||||
|
||||
const { default: NewPersonPage } = await import(
|
||||
"@/app/(dashboard)/people/new/page"
|
||||
)
|
||||
|
||||
renderToStaticMarkup(await NewPersonPage())
|
||||
|
||||
expect(mocks.personForm).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
mode: "create",
|
||||
schemaCopy: es.inventory.people.schema,
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it("passes server-resolved Person schema copy into the edit person form boundary", async () => {
|
||||
mocks.getI18n.mockResolvedValue({ dictionary: en, locale: "en" })
|
||||
mocks.findById.mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user