diff --git a/src/core/client/stream/test/comments/components/CommentContainer.spec.tsx b/src/core/client/stream/test/comments/components/CommentContainer.spec.tsx index 39a41f3b5b..020f091479 100644 --- a/src/core/client/stream/test/comments/components/CommentContainer.spec.tsx +++ b/src/core/client/stream/test/comments/components/CommentContainer.spec.tsx @@ -9,6 +9,7 @@ import { import { commenters, settings, + singleCommentStory, stories, storyWithDeletedComments, storyWithReplies, @@ -51,9 +52,16 @@ async function createTestRenderer( afterEach(jest.clearAllMocks); it("renders username and body", async () => { - const { container } = await createTestRenderer(); + const { container } = await createTestRenderer({ + resolvers: { + Query: { + story: () => singleCommentStory, + stream: () => singleCommentStory, + }, + }, + }); - const firstComment = stories[0].comments.edges[0].node; + const firstComment = singleCommentStory.comments.edges[0].node; const commentElement = await within(container).findByTestId( `comment-${firstComment.id}` ); diff --git a/src/core/client/stream/test/fixtures.ts b/src/core/client/stream/test/fixtures.ts index a961bc8db4..187da7111c 100644 --- a/src/core/client/stream/test/fixtures.ts +++ b/src/core/client/stream/test/fixtures.ts @@ -797,6 +797,19 @@ export const commentsFromStaff = denormalizeComments( ) ); +export const singleCommentStory = denormalizeStory( + createFixture( + { + id: "story-1", + url: "http://localhost/stories/story-1", + comments: { + edges: [{ node: comments[0], cursor: comments[0].createdAt }], + }, + }, + baseStory + ) +); + export const stories = denormalizeStories( createFixtures( [