Skip to content

Commit

Permalink
test: update fixtures to only validate two levels of nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
thisislawatts committed Jan 3, 2024
1 parent 0613656 commit 7fadd1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
7 changes: 1 addition & 6 deletions packages/components/src/CommentList/CommentList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ export const WithNestedComments: StoryFn<typeof CommentList> = () => {
// TODO: This is a temporary solution to get nested comments to pass type check
const comments: any = [
fakeComment({
replies: [
fakeComment({
replies: [fakeComment(), fakeComment(), fakeComment()],
}),
fakeComment(),
],
replies: [fakeComment(), fakeComment()],
}),
fakeComment(),
fakeComment(),
Expand Down
9 changes: 2 additions & 7 deletions packages/components/src/CommentList/CommentList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ describe('CommentList', () => {
it('renders nested comments correctly', () => {
const mockComments = [
fakeComment({
replies: [
fakeComment({
replies: [fakeComment(), fakeComment(), fakeComment()],
}),
fakeComment(),
],
replies: [fakeComment(), fakeComment()],
}),
fakeComment(),
fakeComment(),
Expand All @@ -91,6 +86,6 @@ describe('CommentList', () => {
/>,
)

expect(screen.getAllByTestId('CommentList: item')).toHaveLength(8)
expect(screen.getAllByTestId('CommentList: item')).toHaveLength(5)
})
})

0 comments on commit 7fadd1b

Please sign in to comment.