diff --git a/app/soapbox/jest/factory.ts b/app/soapbox/jest/factory.ts index 4d8ff336a..403904209 100644 --- a/app/soapbox/jest/factory.ts +++ b/app/soapbox/jest/factory.ts @@ -1,5 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; +import { normalizeStatus } from 'soapbox/normalizers'; import { accountSchema, adSchema, @@ -17,9 +18,9 @@ import { type GroupRelationship, type GroupTag, type Relationship, + type Status, } from 'soapbox/schemas'; import { GroupRoles } from 'soapbox/schemas/group-member'; -import { statusSchema, type Status } from 'soapbox/schemas/status'; // TODO: there's probably a better way to create these factory functions. // This looks promising but didn't work on my first attempt: https://github.com/anatine/zod-plugins/tree/main/packages/zod-mock @@ -79,7 +80,7 @@ function buildRelationship(props: Partial = {}): Relationship { } function buildStatus(props: Partial = {}): Status { - return statusSchema.parse(Object.assign({ + return normalizeStatus(Object.assign({ id: uuidv4(), }, props)); }