salix/services/loopback/common/methods/client/specs/card.spec.js

21 lines
631 B
JavaScript
Raw Normal View History

const app = require('../../../../../client/server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
2018-01-24 12:45:32 +00:00
describe('Client card', () => {
it('should call the card() method to receive a formated card of Bruce Wayne', done => {
let id = 101;
2018-01-24 12:45:32 +00:00
let callback = (error, result) => {
if (error) return catchErrors(done)(error);
expect(result).toEqual(jasmine.objectContaining({
id: 101,
2018-01-24 12:45:32 +00:00
name: 'Bruce Wayne'
}));
done();
};
app.models.Client.card(id, callback);
});
});