diff --git a/modules/client/front/sample/create/index.spec.js b/modules/client/front/sample/create/index.spec.js index da9a557f1e..d3817a4399 100644 --- a/modules/client/front/sample/create/index.spec.js +++ b/modules/client/front/sample/create/index.spec.js @@ -107,7 +107,7 @@ describe('Client', () => { expect(controller.$http.get).not.toHaveBeenCalled(); }); - it(`should perform an HTTP query without passing companyId param`, () => { + it(`should perform an HTTP query without passing companyFk param`, () => { controller.$.sampleType.selection = { hasCompany: false, code: 'MyReport' @@ -116,25 +116,34 @@ describe('Client', () => { clientId: 101, recipient: 'client@email.com' }; + const expectedParams = { + clientId: 101, + recipient: 'client@email.com' + }; + const serializedParams = $httpParamSerializer(expectedParams); - const serializedParams = $httpParamSerializer(controller.clientSample); $httpBackend.expect('GET', `email/MyReport?${serializedParams}`).respond(true); controller.send(false, () => {}); $httpBackend.flush(); }); - it(`should perform an HTTP query passing companyId param`, () => { + it(`should perform an HTTP query passing companyFk param`, () => { controller.$.sampleType.selection = { hasCompany: true, code: 'MyReport' }; controller.clientSample = { + clientId: 101, + recipient: 'client@email.com', + companyFk: 442 + }; + const expectedParams = { clientId: 101, recipient: 'client@email.com', companyId: 442 }; + const serializedParams = $httpParamSerializer(expectedParams); - const serializedParams = $httpParamSerializer(controller.clientSample); $httpBackend.expect('GET', `email/MyReport?${serializedParams}`).respond(true); controller.send(false, () => {}); $httpBackend.flush();