Updated unit test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
465955d0c5
commit
418d7a2d12
|
@ -9,8 +9,6 @@ class Controller extends Section {
|
||||||
clientFk: this.$params.id,
|
clientFk: this.$params.id,
|
||||||
companyId: this.vnConfig.companyFk
|
companyId: this.vnConfig.companyFk
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getWorkerEmail();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get client() {
|
get client() {
|
||||||
|
@ -20,8 +18,10 @@ class Controller extends Section {
|
||||||
set client(value) {
|
set client(value) {
|
||||||
this._client = value;
|
this._client = value;
|
||||||
|
|
||||||
if (value)
|
if (value) {
|
||||||
this.clientSample.recipient = value.email;
|
this.clientSample.recipient = value.email;
|
||||||
|
this.getWorkerEmail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get companyId() {
|
get companyId() {
|
||||||
|
|
|
@ -179,5 +179,17 @@ describe('Client', () => {
|
||||||
expect(controller.$state.go).toHaveBeenCalledWith('client.card.sample.index');
|
expect(controller.$state.go).toHaveBeenCalledWith('client.card.sample.index');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('getWorkerEmail()', () => {
|
||||||
|
it(`should perform a query and then set the replyTo property to the clientSample object`, () => {
|
||||||
|
const expectedEmail = 'batman@arkhamcity.com';
|
||||||
|
const serializedParams = $httpParamSerializer({filter: {where: {}}});
|
||||||
|
$httpBackend.expect('GET', `EmailUsers?${serializedParams}`).respond([{email: expectedEmail}]);
|
||||||
|
controller.getWorkerEmail();
|
||||||
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
expect(controller.clientSample.replyTo).toEqual(expectedEmail);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue