test(fragment): add baseBMP ARX decode regression tests#22
Conversation
Add two tests in fragment.test.ts for decoding baseBMP-encoded ARX fragments via decodeFragmentAsync: one for direct baseBMP payloads and one for percent-escaped BMP characters. Covers the sync-adjacent decode path that was previously untested for arx.N.<baseBMP> wire format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds two async test cases to verify ARX fragment decoding functionality. Tests construct ARX-codec PayloadEnvelopes, serialize and compress them, embed results into hash fragments, and verify successful parsing with correct title content, including one test with percent-escaped non-ASCII characters. Changes
Possibly related PRs
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
| expect(parsed.code).toBe("decoded-too-large"); | ||
| }); | ||
|
|
||
| it("decodes a baseBMP-encoded arx fragment (sync path)", async () => { |
There was a problem hiding this comment.
SUGGESTION: Misleading test name — says "sync path" but uses decodeFragmentAsync. The sync decodeFragment explicitly rejects arx codec (see src/lib/payload/fragment.ts:321).
| it("decodes a baseBMP-encoded arx fragment (sync path)", async () => { | |
| it("decodes a baseBMP-encoded arx fragment (async path)", async () => { |
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (1 files)
NotesThe two new tests look correct — they properly exercise the Reviewed by mimo-v2-pro-20260318 · 106,938 tokens |
Deploying agent-render with
|
| Latest commit: |
4288ffb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4e3e2162.agent-render.pages.dev |
| Branch Preview URL: | https://claude-add-basebmp-arx-fragm.agent-render.pages.dev |
Summary
tests/fragment.test.tsfor decoding baseBMP-encoded ARX fragments viadecodeFragmentAsyncv1.arx.N.<baseBMP-payload>fragments that was previously only tested inarx-codec.test.tsTest plan
npx vitest run tests/fragment.test.ts— all 12 tests pass (10 existing + 2 new)🤖 Generated with Claude Code
Summary by CodeRabbit