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 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-07-17 19:57:07 +03:00
parent 934d2e2170
commit 1ea30c64f0
+7 -4
View File
@@ -73,14 +73,17 @@ describe('isXrpcErrorOf', () => {
).toBe(true) ).toBe(true)
}) })
it('does not match a different error code or a non-XRPC value', () => { it('does not match a different error code', () => {
expect( expect(
isXrpcErrorOf( isXrpcErrorOf(
chat.bsky.convo.getMessages, chat.bsky.group.approveJoinRequest,
lexError(400, 'InvalidConvo'), lexError(400, 'InvalidConvo'),
'InvalidConvo', 'InsufficientRole',
), ),
).toBe(true) ).toBe(false)
})
it('does not match a non-XRPC value', () => {
expect( expect(
isXrpcErrorOf( isXrpcErrorOf(
chat.bsky.convo.acceptConvo, chat.bsky.convo.acceptConvo,