MCPcopy Create free account
hub / github.com/dailydotdev/apps / createPost

Function createPost

packages/webapp/__tests__/ReadArticleStaticProps.spec.ts:22–44  ·  view source on GitHub ↗
(overrides: Partial<Post> = {})

Source from the content-addressed store, hash-verified

20const mockRequest = gqlClient.request as jest.Mock;
21
22const createPost = (overrides: Partial<Post> = {}): Post =>
23 ({
24 id: 'post-id',
25 type: PostType.Article,
26 title: 'Programmatic ad article',
27 slug: 'programmatic-ad-article',
28 summary: 'A concise summary for the programmatic ad article.',
29 contentHtml: '',
30 createdAt: new Date('2024-01-01').toISOString(),
31 updatedAt: new Date('2024-01-02').toISOString(),
32 language: 'en',
33 tags: ['ads'],
34 image: 'https://example.com/post.png',
35 source: {
36 name: 'daily.dev',
37 public: true,
38 },
39 author: {
40 reputation: 11,
41 permalink: 'https://example.com/@author',
42 },
43 ...overrides,
44 }) as Post;
45
46describe('read article static props', () => {
47 beforeEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected