@fye/xservices-client
Version:
FYE Micros Xservices Client
47 lines (38 loc) • 1.2 kB
JavaScript
var expect = require('expect.js');
var RegisterService = require('../lib/register');
var config = require('./service_config.json');
describe('RegisterService', function() {
this.timeout(200000);
var service = new RegisterService(config.service.opts, config.service.conns);
describe('.getRegisterStoreStatus', function() {
var status;
var error;
before(function(done) {
service.getRegisterStoreStatus({
serviceContext: config.context
}, function(err, s) {
status = s;
error = err;
done();
});
});
it('should not return an error when passed context', function() {
expect(error).to.be(null);
});
it('should return a status object', function() {
expect(status).to.be.an('object');
});
it('should have the register status fields', function() {
expect(status).to.have.keys([
'registerOpen',
'storeOpen',
'businessDate'
]);
});
it('should properly convert data types', function() {
expect(status.storeOpen).to.be.a('boolean');
expect(status.registerOpen).to.be.a('boolean');
expect(status.businessDate).to.be.a(Date);
});
});
});