Skip to content

Conversation

@kanake10
Copy link
Contributor

Goal

Ensure test consistency by updating onCommentAdded test cases to use the existing addReply logic.

Implementation

Updated onCommentAdded tests to use addReply for consistency

Testing

Confirmed that reply counts and lists are correctly updated when adding replies.

Ensured non-reply comments are ignored as expected.

Checklist

  • No Issue linked (if any)
  • CommentReplyListStateImplTest updated
  • I have signed the Stream CLA (required for external contributors)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

PR checklist ❌

The following issues were detected:

  • Missing required label: at least one label starting with pr:.

What we check

  1. Title is concise (5–18 words) unless labeled pr:ignore-for-release.
  2. At least one pr: label exists (e.g., pr:bug, pr:new-feature).
  3. Sections ### Goal, ### Implementation, and ### Testing contain content.

@kanake10 kanake10 changed the title use addReply funtion to build the expected state use addReply funtion should build the expected state Oct 16, 2025
@kanake10 kanake10 changed the title use addReply funtion should build the expected state use addReply funtion to build the expected state Oct 16, 2025
Comment on lines +79 to -80
val expectedParent = parentComment.addReply(newReply, Comparator { _, _ -> 0 })

state.onCommentAdded(newReply)

val expectedParent = parentComment.copy(replies = listOf(newReply), replyCount = 1)
Copy link
Contributor

@gpunto gpunto Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using production code to build the expected result, we usually favor stating it explicitly. Otherwise, if the addReply function has a bug, we would not catch it. This is why replies and replyCount were set explicitly.

Copy link
Contributor Author

@kanake10 kanake10 Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will close this PR

@kanake10
Copy link
Contributor Author

@gpunto
question not related to this PR: in the demo app, are those features (like loading feed or posting an activity) only accessible to users registered in the backend?

@gpunto
Copy link
Contributor

gpunto commented Oct 20, 2025

@gpunto question not related to this PR: in the demo app, are those features (like loading feed or posting an activity) only accessible to users registered in the backend?

Yes, we only support the users hardcoded in the app for the time being.

@kanake10 kanake10 closed this Oct 20, 2025
@kanake10 kanake10 deleted the update-comment-tests-addreply branch October 20, 2025 16:07
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