From e288660d3e09d7e4cab969e88d6d409fd110f2d6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 24 Dec 2025 21:49:23 -0600 Subject: [PATCH] Fix tests --- src/lib/git.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/git.test.ts b/src/lib/git.test.ts index 0ee8c2a6..3049c2ac 100644 --- a/src/lib/git.test.ts +++ b/src/lib/git.test.ts @@ -218,6 +218,9 @@ describe('Git', () => { it('successfully clones from Nostr URI and updates origin remote', async () => { const nostrUrl = 'nostr://npub1abc123/my-repo'; + // The mock npubEncode creates npub1 + first 10 chars of the hex pubkey + // pubkey: 'abcd1234567890...' -> npub1abcd123456 + const expectedNostrUrl = 'nostr://npub1abcd123456/my-repo'; await gitInstance.clone({ dir: '/test', @@ -239,12 +242,12 @@ describe('Git', () => { remote: 'origin', }); - // Should add the Nostr URI as the new origin + // Should add the Nostr URI as the new origin (with properly encoded npub) expect(mockGit.addRemote).toHaveBeenCalledWith({ fs, dir: '/test', remote: 'origin', - url: nostrUrl, + url: expectedNostrUrl, }); }); });