feat(client): add backTest
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d4136cde0b
commit
86b24ecd1d
|
@ -0,0 +1,24 @@
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
describe('client checkDuplicated()', () => {
|
||||||
|
it('should send an mail if mobile/phone/email is duplicated', async() => {
|
||||||
|
const tx = await models.Client.beginTransaction({});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
const id = 1110;
|
||||||
|
const mailModel = models.Mail;
|
||||||
|
spyOn(mailModel, 'create');
|
||||||
|
|
||||||
|
await models.Client.checkDuplicatedData(id, options);
|
||||||
|
|
||||||
|
expect(mailModel.create).toHaveBeenCalled();
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -10,9 +10,10 @@ export default class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
return this.$.watcher.submit()
|
return this.$.watcher.submit().then(json => {
|
||||||
.then(json => this.$state.go('client.card.basicData', {id: json.data.id}))
|
this.$state.go('client.card.basicData', {id: json.data.id});
|
||||||
.then(() => this.$http.get(`Clients/${this.client.id}/checkDuplicatedData`));
|
this.$http.get(`Clients/${this.client.id}/checkDuplicatedData`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get province() {
|
get province() {
|
||||||
|
|
Loading…
Reference in New Issue