We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e9f3e0a + 12028c5 commit 89cfcdeCopy full SHA for 89cfcde
helpers/appHelper.spec.ts
@@ -137,6 +137,15 @@ describe('helpers/appHelper', () => {
137
expect(detail.currentSeason.episodes).toEqual([]);
138
});
139
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
+
149
test('getSeriesDetail returns empty when id missing', async () => {
150
const detail = await helper.getSeriesDetail('', 1);
151
expect(detail).toEqual({ totalSeasons: 0, currentSeason: { season: 0, episodes: [] } });
0 commit comments