Skip to content

Commit 89cfcde

Browse files
Merge pull request #50 from justinhartman/develop
Merge code coverage test into main
2 parents e9f3e0a + 12028c5 commit 89cfcde

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

helpers/appHelper.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ describe('helpers/appHelper', () => {
137137
expect(detail.currentSeason.episodes).toEqual([]);
138138
});
139139

140+
test('getSeriesDetail handles missing response data', async () => {
141+
(http.request as jest.Mock).mockResolvedValueOnce({});
142+
const detail = await helper.getSeriesDetail('tt4', 1);
143+
expect(detail).toEqual({
144+
totalSeasons: 0,
145+
currentSeason: { season: 1, episodes: [] },
146+
});
147+
});
148+
140149
test('getSeriesDetail returns empty when id missing', async () => {
141150
const detail = await helper.getSeriesDetail('', 1);
142151
expect(detail).toEqual({ totalSeasons: 0, currentSeason: { season: 0, episodes: [] } });

0 commit comments

Comments
 (0)