From 57f7d7a016958251a88454332ce91dd6ef70e997 Mon Sep 17 00:00:00 2001 From: Sebastian Legarraga <64795732+slegarraga@users.noreply.github.com> Date: Thu, 6 Aug 2026 17:31:06 -0400 Subject: [PATCH] test: unskip useGitHub branchName test Signed-off-by: Sebastian Legarraga <64795732+slegarraga@users.noreply.github.com> --- src/app/sandbox/hooks/useGitHub.test.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/sandbox/hooks/useGitHub.test.ts b/src/app/sandbox/hooks/useGitHub.test.ts index 3fbd314..b62c810 100644 --- a/src/app/sandbox/hooks/useGitHub.test.ts +++ b/src/app/sandbox/hooks/useGitHub.test.ts @@ -229,16 +229,18 @@ describe('useGitHub', () => { expect(updatedFile?.sha).toBe('updated-sha'); }); - // NOTE: This test is stale relative to the current source: updateFileOnGitHub returns - // null (after showing a toast) when branchName is missing rather than throwing, so the - // .rejects.toThrow assertion fails on main too. The unit suites are not run in CI, so - // the drift went unnoticed. Skipping to avoid masking it as a migration regression. - test.skip('should throw an error if branchName is missing', async () => { + test('returns null if branchName is missing', async () => { const { result } = renderHook(() => useGitHub(true, 'test-user')); await act(async () => { result.current.setForkName('test-user-fork'); }); - await expect(result.current.updateFileOnGitHub(mockBlueprint.path, 'new content', mockBlueprint.sha, '')).rejects.toThrow('A branch name is required to update a file on GitHub.'); + const updatedFile = await result.current.updateFileOnGitHub( + mockBlueprint.path, + 'new content', + mockBlueprint.sha, + '', + ); + expect(updatedFile).toBeNull(); }); }); @@ -306,4 +308,4 @@ describe('useGitHub', () => { }); }); }); -}); \ No newline at end of file +});