(overrides: Partial<Post> = {})
| 20 | const mockRequest = gqlClient.request as jest.Mock; |
| 21 | |
| 22 | const 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 | |
| 46 | describe('read article static props', () => { |
| 47 | beforeEach(() => { |
no outgoing calls
no test coverage detected