#235 back end unit tests for getAverageInvoiced
This commit is contained in:
parent
5550b9cbba
commit
3e8b26c91e
|
@ -8,27 +8,27 @@
|
|||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"address": {
|
||||
"type": "belongsTo",
|
||||
"model": "Address",
|
||||
"foreignKey": "addressFk"
|
||||
},
|
||||
"observationType": {
|
||||
"type": "belongsTo",
|
||||
"model": "ObservationType",
|
||||
"foreignKey": "observationTypeFk"
|
||||
}
|
||||
"address": {
|
||||
"type": "belongsTo",
|
||||
"model": "Address",
|
||||
"foreignKey": "addressFk"
|
||||
},
|
||||
"observationType": {
|
||||
"type": "belongsTo",
|
||||
"model": "ObservationType",
|
||||
"foreignKey": "observationTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
const getAverageInvoiced = require('../getAverageInvoiced');
|
||||
const {rawSql} = require('./helpers');
|
||||
const model = {
|
||||
remoteMethod: () => {}
|
||||
};
|
||||
|
||||
rawSql(model);
|
||||
getAverageInvoiced(model);
|
||||
|
||||
describe('client getAverageInvoiced()', () => {
|
||||
it('should call the getAverageInvoiced method', done => {
|
||||
model.getAverageInvoiced(101)
|
||||
.then(response => {
|
||||
expect(response.invoiced).toEqual(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue