From 1ea30c64f09981a92fdd39ea03b782c09359c976 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 17 Jul 2026 19:57:07 +0300 Subject: [PATCH] fix isXrpcErrorOf mismatch test to actually test a mismatch The 'different error code' test asserted a MATCHING code returns true (with an unrelated method as witness), contradicting its own name and leaving the code-mismatch path untested. Split into two tests: a real mismatch (approveJoinRequest declares both names, so no as-any cast needed) asserting false, and the non-XRPC case. Found by a roast pass over the error-matching changes. Co-Authored-By: Claude Fable 5 --- src/lib/strings/__tests__/errors.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/strings/__tests__/errors.test.ts b/src/lib/strings/__tests__/errors.test.ts index 6bb1f5f347..eba7170de3 100644 --- a/src/lib/strings/__tests__/errors.test.ts +++ b/src/lib/strings/__tests__/errors.test.ts @@ -73,14 +73,17 @@ describe('isXrpcErrorOf', () => { ).toBe(true) }) - it('does not match a different error code or a non-XRPC value', () => { + it('does not match a different error code', () => { expect( isXrpcErrorOf( - chat.bsky.convo.getMessages, + chat.bsky.group.approveJoinRequest, lexError(400, 'InvalidConvo'), - 'InvalidConvo', + 'InsufficientRole', ), - ).toBe(true) + ).toBe(false) + }) + + it('does not match a non-XRPC value', () => { expect( isXrpcErrorOf( chat.bsky.convo.acceptConvo,