(
overrides: Partial<Post> & {
significance?: PostHeroSignificance | null;
} = {},
)
| 21 | }; |
| 22 | |
| 23 | const makePost = ( |
| 24 | overrides: Partial<Post> & { |
| 25 | significance?: PostHeroSignificance | null; |
| 26 | } = {}, |
| 27 | ): Post => { |
| 28 | const { significance, ...rest } = overrides; |
| 29 | return { |
| 30 | id: rest.id ?? 'p1', |
| 31 | type: rest.type ?? PostType.Article, |
| 32 | image: 'https://example.com/img.jpg', |
| 33 | commentsPermalink: '', |
| 34 | ...(significance !== undefined && { |
| 35 | hero: significance |
| 36 | ? { |
| 37 | id: 'h1', |
| 38 | highlightedAt: '2026-05-25T00:00:00.000Z', |
| 39 | headline: 'h', |
| 40 | significance, |
| 41 | size: SIZE_BY_SIGNIFICANCE[significance], |
| 42 | } |
| 43 | : null, |
| 44 | }), |
| 45 | ...rest, |
| 46 | } as Post; |
| 47 | }; |
| 48 | |
| 49 | const makePostItem = (post: Post): FeedItem => |
| 50 | ({ type: FeedItemType.Post, post }) as FeedItem; |
no outgoing calls
no test coverage detected