From 907358edc593a89dcfffdabf0ce6bdbba9b9bbfc Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 17 Dec 2019 09:58:05 +0100 Subject: [PATCH] add test to prove the response body isn't part of the output --- .../status-code-only-response-parsing.service.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/core/data/status-code-only-response-parsing.service.spec.ts b/src/app/core/data/status-code-only-response-parsing.service.spec.ts index 8d7ae9bbf7..cbf2a49c48 100644 --- a/src/app/core/data/status-code-only-response-parsing.service.spec.ts +++ b/src/app/core/data/status-code-only-response-parsing.service.spec.ts @@ -11,6 +11,17 @@ describe('StatusCodeOnlyResponseParsingService', () => { describe('parse', () => { + it('should return a RestResponse that doesn\'t contain the response body', () => { + const payload = 'd9128e44-183b-479d-aa2e-d39435838bf6'; + const result = service.parse(undefined, { + payload, + statusCode: 201, + statusText: '201' + }); + + expect(JSON.stringify(result).indexOf(payload)).toBe(-1); + }); + describe('when the response is successful', () => { beforeEach(() => { statusCode = 201;