Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

The refactored add_reaction_and_edit_comment.cjs consolidated error handling for discussion comments, resulting in a more general error message. One test assertion was still expecting the old specific error message.

Changes

  • Updated test assertion to match new error message: "Discussion or comment information not found in event payload"
  • Applied Prettier formatting to align with code style

Context

The refactored code now validates discussionNumber, commentId, and commentNodeId together in a single conditional check, producing a unified error message instead of separate messages for each missing field.

// Refactored validation
if (!discussionNumber || !commentId || !commentNodeId) {
  core.setFailed("Discussion or comment information not found in event payload");
  return null;
}

All 15 tests for add_reaction_and_edit_comment.cjs now pass.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Update test to match the refactored error message. The code now uses a more comprehensive check
that validates discussionNumber, commentId, and commentNodeId together, resulting in a more
general error message: "Discussion or comment information not found in event payload"

Co-authored-by: pelikhan <[email protected]>
Copilot AI changed the title [WIP] Clean add_reaction_and_edit_comment.cjs for better readability test: fix error message assertion in add_reaction_and_edit_comment tests Dec 30, 2025
Copilot AI requested a review from pelikhan December 30, 2025 16:10
@pelikhan pelikhan marked this pull request as ready for review December 30, 2025 16:10
@pelikhan pelikhan merged commit af5108b into main-b3ff1547cea99307 Dec 30, 2025
@pelikhan pelikhan deleted the copilot/sub-pr-8179 branch December 30, 2025 16:10
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