im.client.application.Test.js 976 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * IM客户端单元测试。单元测试编写规则:至少对对每个接口执行正反例测试,若有条件可以增加接口的性能测试。
  3. *
  4. * @author sand
  5. * @since 2016/12/24
  6. */
  7. "use strict";
  8. var $ = require('jquery');
  9. let assert = require('assert');
  10. let imClient = require('../../src/client/im.client');
  11. // 测试会话用的数据, test data
  12. let TD = {
  13. DoctorA: {
  14. id: "D2016008240003"
  15. }
  16. };
  17. // Application API
  18. describe("Application API", function () {
  19. describe("getBadgeNo", function () {
  20. it("return success when with valid user", function (done) {
  21. imClient.Application.getBadgeNo(TD.DoctorA.id,
  22. function (data) {
  23. assert.ok(data.count >= 0, "Do you forget finish the API?");
  24. done();
  25. },
  26. function (xhr, error, status) {
  27. assert.ok(false, xhr.responseJSON.message);
  28. done();
  29. });
  30. });
  31. });
  32. });