user.Test.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. *
  3. * author: Sand
  4. * since: 12/13/2016
  5. */
  6. "use strict";
  7. var assert = require('assert');
  8. var redis = require('redis');
  9. var Users = require('../../../../src/server/models/user/users');
  10. describe('Users class', function () {
  11. describe('isPatientId', function () {
  12. it('true with really patient id', function (done) {
  13. let users = new Users();
  14. users.isPatientIdAsync('915cc456-5b1d-11e6-8344-fa163e8aee56').then(function (res) {
  15. assert.strictEqual(res, true);
  16. done();
  17. });
  18. });
  19. it('false with random id', function (done) {
  20. let users = new Users();
  21. users.isPatientIdAsync('not-patient_id').then(function (res) {
  22. assert.strictEqual(res, false);
  23. done();
  24. });
  25. })
  26. });
  27. describe('getUser', function () {
  28. it('should return user info', function (done) {
  29. let users = new Users();
  30. users.getUserAsync('test00000000006').then(function (res) {
  31. assert.notStrictEqual(res, null);
  32. if(res !== null) console.log(res);
  33. done();
  34. });
  35. });
  36. });
  37. });