"use strict"; let assert = require('assert'); let imClient = require('../../src/client/im.client'); let userId = 'D2016008240002'; describe('API: Search', function () { // 搜索所有 describe('search all object types', function () { it('should return 200', function (done) { imClient.Search.searchAll(userId, '哦', function (data) { assert(data.length > 0, "Search must return at least one data"); }, function (xhr, status, error) { assert.ok(false, xhr.responseJSON.message); done(); }); }); }); // 搜索医生 describe('search doctors', function () { it('should return 200', function (done) { imClient.Search.searchDoctors('张', function (data) { assert(data.length > 0, "Search must return at least one data"); }, function (xhr, status, error) { assert.ok(false, xhr.responseJSON.message); done(); }); }); }); // 搜索会话 describe('search sessions', function () { it('should return 200', function (done) { imClient.Search.searchSessions(userId, '小', function (data) { assert(data.length > 0, "Search must return at least one data"); }, function (xhr, status, error) { assert.ok(false, xhr.responseJSON.message); done(); }); }); }); // 搜索会话消息 describe('search sessions', function () { it('should return 200', function (done) { imClient.Search.searchMessages(userId, '哦', function (data) { assert(data.length > 0, "Search must return at least one data"); }, function (xhr, status, error) { assert.ok(false, xhr.responseJSON.message); done(); }); }); }); });