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

Function createPostMock

packages/shared/src/components/Feed.spec.tsx:2245–2289  ·  view source on GitHub ↗
(
    data: Partial<Post> = {},
  )

Source from the content-addressed store, hash-verified

2243 });
2244
2245 const createPostMock = (
2246 data: Partial<Post> = {},
2247 ): MockedGraphQLResponse<PostData> => ({
2248 request: {
2249 query: POST_BY_ID_QUERY,
2250 variables: {
2251 id: data.id ?? '0e4005b2d3cf191f8c44c2718a457a1e',
2252 },
2253 },
2254 result: {
2255 data: {
2256 post: {
2257 id: '0e4005b2d3cf191f8c44c2718a457a1e',
2258 __typename: 'PostPage',
2259 title: 'Eminem Quotes Generator - Simple PHP RESTful API',
2260 summary: '',
2261 permalink: 'http://localhost:4000/r/9CuRpr5NiEY5',
2262 image:
2263 'https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/22fc3ac5cc3fedf281b6e4b46e8c0ba2',
2264 createdAt: '2019-05-16T15:16:05.000Z',
2265 readTime: 8,
2266 tags: ['development', 'data-science', 'sql'],
2267 source: {
2268 __typename: 'Source',
2269 id: 's',
2270 name: 'Towards Data Science',
2271 handle: 's',
2272 permalink: 's',
2273 image:
2274 'https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tds',
2275 type: SourceType.Machine,
2276 public: true,
2277 },
2278 upvoted: false,
2279 commented: false,
2280 bookmarked: false,
2281 commentsPermalink: 'https://localhost:5002/posts/9CuRpr5NiEY5',
2282 numUpvotes: 0,
2283 numComments: 0,
2284 type: PostType.Article,
2285 ...data,
2286 },
2287 },
2288 },
2289 });
2290
2291 it('should be able to navigate through posts', async () => {
2292 jest.mocked(useRouter).mockImplementation(() => {

Callers 1

Feed.spec.tsxFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected