Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set explicit limit for getPosts/getComments in tests #4250

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented Dec 12, 2023

Looking at CI test failures, I noticed there were a couple cases where the expected value wasnt found in return value from getPosts():


  ● moderator view

    expect(received).toContain(expected) // indexOf

    Expected value: 35
    Received array: [34, 27, 26, 22, 21, 20, 19, 15, 14, 13]

      295 |   let commentIds = comments.map(comment => comment.comment.id);
      296 |
    > 297 |   expect(postIds).toContain(otherPost.post.id);
          |                   ^
      298 |   expect(commentIds).toContain(otherComment.comment.id);
      299 |
      300 |   expect(postIds).toContain(alphaPost.post.id);

      at Object.<anonymous> (src/community.spec.ts:297:19)

https://woodpecker.join-lemmy.org/repos/129/pipeline/4262/20
https://woodpecker.join-lemmy.org/repos/129/pipeline/4276/20

This seems to happen because it uses the default limit which is 10, but there are more posts than that and the expected value is not returned. So setting an explicit, high limit should resolve this.

@dessalines dessalines merged commit b2ae69f into main Dec 12, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants