git-release-manager: fix test
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user