git-release-manager: fix test

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-09-18 00:58:51 +02:00
parent 2f9065d8fd
commit 59f9d7176a
@@ -70,7 +70,9 @@ describe('useGetHubBatchInfo', () => {
});
it('should handle repositories without any releases', async () => {
(mockApiClient.getLatestRelease as jest.Mock).mockResolvedValueOnce(null);
(mockApiClient.getLatestRelease as jest.Mock).mockResolvedValueOnce({
latestRelease: null,
});
const { result } = renderHook(() =>
useGetGitBatchInfo({
@@ -85,8 +87,16 @@ describe('useGetHubBatchInfo', () => {
expect(result.current.gitBatchInfo).toMatchInlineSnapshot(`
Object {
"error": [TypeError: Cannot read property 'latestRelease' of null],
"loading": false,
"value": Object {
"latestRelease": null,
"releaseBranch": null,
"repository": Object {
"defaultBranch": "mock_defaultBranch",
"name": "mock_repo",
"pushPermissions": true,
},
},
}
`);
});