updated unit tests
gitea/salix/2127-sample_disable_preview This commit looks good
Details
gitea/salix/2127-sample_disable_preview This commit looks good
Details
This commit is contained in:
parent
d66c53dbf2
commit
1d326a52c8
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue