Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 252a43a

Browse files
committed
Fixed tests.
1 parent c96f588 commit 252a43a

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

packages/app/client/src/state/sagas/botSagas.spec.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,12 @@ describe('The botSagas', () => {
281281
gen.next('Cannot read property "id" of undefined.');
282282
expect(true).toBe(false); // ensure catch is hit
283283
} catch (e) {
284-
expect(e).toEqual(
285-
new Error(
286-
'Error occurred while starting a new conversation 500 INTERNAL SERVER ERROR: Cannot read property "id" of undefined.'
287-
)
288-
);
284+
expect(e).toEqual({
285+
description: '500 INTERNAL SERVER ERROR',
286+
message: 'Error occurred while starting a new conversation',
287+
innerMessage: 'Cannot read property "id" of undefined.',
288+
status: 500,
289+
});
289290
}
290291
});
291292

@@ -340,11 +341,12 @@ describe('The botSagas', () => {
340341
gen.next('Could not read property "id" of undefined.');
341342
expect(true).toBe(false); // ensure catch is hit
342343
} catch (e) {
343-
expect(e).toEqual(
344-
new Error(
345-
'Error occurred while sending the initial log report 500 INTERNAL SERVER ERROR: Could not read property "id" of undefined.'
346-
)
347-
);
344+
expect(e).toEqual({
345+
description: '500 INTERNAL SERVER ERROR',
346+
message: 'Error occurred while sending the initial log report',
347+
innerMessage: 'Could not read property "id" of undefined.',
348+
status: 500,
349+
});
348350
}
349351
});
350352

@@ -401,11 +403,12 @@ describe('The botSagas', () => {
401403
gen.next('Could not read property "id" of undefined.');
402404
expect(true).toBe(false); // ensure catch is hit
403405
} catch (e) {
404-
expect(e).toEqual(
405-
new Error(
406-
'Error occurred while sending the initial activity 500 INTERNAL SERVER ERROR: Could not read property "id" of undefined.'
407-
)
408-
);
406+
expect(e).toEqual({
407+
description: '500 INTERNAL SERVER ERROR',
408+
message: 'Error occurred while sending the initial activity',
409+
innerMessage: 'Could not read property "id" of undefined.',
410+
status: 500,
411+
});
409412
}
410413
});
411414
});

packages/app/client/src/state/sagas/chatSagas.spec.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,12 @@ describe('The ChatSagas,', () => {
376376
gen.next('The server could not handle your request.'); // response.text() inside throwErrorFromResponse()
377377
expect(true).toBe(false); // ensure catch is hit
378378
} catch (e) {
379-
expect(e).toEqual(
380-
new Error(
381-
'Error occurred while starting a new conversation 500 INTERNAL SERVER ERROR: The server could not handle your request.'
382-
)
383-
);
379+
expect(e).toEqual({
380+
description: '500 INTERNAL SERVER ERROR',
381+
message: 'Error occurred while starting a new conversation',
382+
innerMessage: 'The server could not handle your request.',
383+
status: 500,
384+
});
384385
}
385386
});
386387

@@ -466,11 +467,12 @@ describe('The ChatSagas,', () => {
466467
gen.next('The server could not handle your request.'); // response.text() inside throwErrorFromResponse()
467468
expect(true).toBe(false); // ensure catch is hit
468469
} catch (e) {
469-
expect(e).toEqual(
470-
new Error(
471-
'Error occurred while feeding activities as a transcript 500 INTERNAL SERVER ERROR: The server could not handle your request.'
472-
)
473-
);
470+
expect(e).toEqual({
471+
description: '500 INTERNAL SERVER ERROR',
472+
message: 'Error occurred while feeding activities as a transcript',
473+
innerMessage: 'The server could not handle your request.',
474+
status: 500,
475+
});
474476
}
475477
});
476478
});
@@ -1056,11 +1058,12 @@ describe('The ChatSagas,', () => {
10561058
gen.next('The server could not handle your request.'); // response.text() inside throwErrorFromResponse()
10571059
expect(true).toBe(false);
10581060
} catch (e) {
1059-
expect(e).toEqual(
1060-
new Error(
1061-
'Error occurred while updating a conversation 500 INTERNAL SERVER ERROR: The server could not handle your request.'
1062-
)
1063-
);
1061+
expect(e).toEqual({
1062+
description: '500 INTERNAL SERVER ERROR',
1063+
message: 'Error occurred while updating a conversation',
1064+
innerMessage: 'The server could not handle your request.',
1065+
status: 500,
1066+
});
10641067
}
10651068
});
10661069
});

0 commit comments

Comments
 (0)