Skip to content

fix: update test to parse response body for encoding error message#1758

Merged
Artuomka merged 1 commit into
mainfrom
backend_fixes
May 7, 2026
Merged

fix: update test to parse response body for encoding error message#1758
Artuomka merged 1 commit into
mainfrom
backend_fixes

Conversation

@Artuomka
Copy link
Copy Markdown
Collaborator

@Artuomka Artuomka commented May 7, 2026

Summary by CodeRabbit

  • Tests
    • Updated test validation for Binary widget parameter error handling to improve test reliability.

Copilot AI review requested due to automatic review settings May 7, 2026 08:56
@Artuomka Artuomka enabled auto-merge May 7, 2026 08:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18792d69-d64b-473c-9377-7dfdc694635a

📥 Commits

Reviewing files that changed from the base of the PR and between ac2f753 and b9f82bd.

📒 Files selected for processing (1)
  • backend/test/ava-tests/saas-tests/table-widgets-e2e.test.ts

📝 Walkthrough

Walkthrough

This PR updates the Binary widget e2e test to properly parse the HTTP response body as JSON before asserting on the error message, replacing a direct substring check against the raw response text. The assertion validates the same Messages.WIDGET_PARAMETER_UNSUPPORTED error for unsupported encoding parameters.

Changes

Binary Widget Encoding Test Fix

Layer / File(s) Summary
Test Assertion Update
backend/test/ava-tests/saas-tests/table-widgets-e2e.test.ts
Invalid encoding test refactored to parse JSON response and validate body.message instead of checking raw createResponse.text for the Messages.WIDGET_PARAMETER_UNSUPPORTED('encoding', WidgetTypeEnum.Binary) error message.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A test that once read raw reply,
Now parses JSON with a sigh—
The Binary bounds are checked once more,
With structured truth at test's own door! 🐇✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating a test to parse response body for an encoding error message in the Binary widget e2e test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed PR properly parses backend HTTP response as JSON, following established test patterns. No security regression; JSON.parse on controlled API responses is safe with no injection vectors.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend_fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Binary widget E2E test to assert the server’s “unsupported encoding” error message by parsing the JSON response body (instead of matching against the raw response text), making the assertion resilient to JSON string escaping/encoding.

Changes:

  • Parse the 400-response payload as JSON in the “invalid encoding value” test case.
  • Assert against body.message (decoded string) rather than searching within createResponse.text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Artuomka Artuomka merged commit 1f20243 into main May 7, 2026
22 of 23 checks passed
@Artuomka Artuomka deleted the backend_fixes branch May 7, 2026 09: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