small file name refactor and client employee backend unit tests

This commit is contained in:
Carlos Jimenez 2018-01-24 15:13:42 +01:00
parent 48aef1f9b0
commit 506d6e0688
5 changed files with 42 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import app from '../../../../server/server';
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
describe('Client card', () => {
it('should call the card() method to receive a formatd card', done => {
it('should call the card() method to receive a formatd card of Bruce Wayne', done => {
let id = 1;
let callback = (error, result) => {

View File

@ -0,0 +1,39 @@
import app from '../../../../server/server';
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
describe('Client employeeList', () => {
it('should call the employeeList()', done => {
let callback = (error, result) => {
if (error) return catchErrors(done)(error);
expect(result).toEqual(jasmine.objectContaining([
{
id: 4,
name: 'Bruce Banner'
},
{
id: 3,
name: 'Charles Xavier'
},
{
id: 1,
name: 'David Charles Haller'
},
{
id: 2,
name: 'Hank Pym'
},
{
id: 5,
name: 'Jessica Jones'
},
{
id: 20,
name: 'Victor Stone'
}
]));
done();
};
app.models.Client.employeeList(callback);
});
});

View File

@ -1,4 +1,4 @@
import totalGreuge from '../totalGreuge';
import totalGreuge from '../total';
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
describe('Greuge totalGreuge()', () => {

View File

@ -1,6 +1,6 @@
module.exports = function(Self) {
require('../methods/greuge/filter.js')(Self);
require('../methods/greuge/totalGreuge.js')(Self);
require('../methods/greuge/total.js')(Self);
Self.validatesLengthOf('description', {
max: 45,