"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const clientBase_1 = require("../clients/clientBase");
const clientManager_1 = require("../clientManager");
var expect = require('chai').expect;
var assert = require('chai').assert;
var sinon = require('sinon');
var name = 'test channel';
var data = { 'client': 'test', 'client_type': 'site', 'user_id': 125, 'user_type': 'user', 'channel': name };
var WebSocketClient = require('websocket').client;
var wsClient = new WebSocketClient();
var client = new clientBase_1.default(data, wsClient);
let clientManager = new clientManager_1.default();
describe('ClientManager', function () {
    it('should add a client', function () {
        var result = clientManager.addClient(data, wsClient);
        expect(result.id).to.be.equal(125);
    });
    it('should get clients of type', function () {
        var result = clientManager.clientsOfType('site');
        assert(result.length > 0, 'returns one client');
    });
    it('should see client exists', function () {
        var exists = clientManager.clientExists(data.user_id);
        var result = exists ? true : false;
        expect(result).to.be.equal(true);
    });
    it('should see client does not exists', function () {
        var exists = clientManager.clientExists(200);
        var result = exists ? true : false;
        expect(result).to.be.equal(false);
    });
    it('should get an existing client', function () {
        var exists = clientManager.getClient(data.user_id);
        var result = exists ? true : false;
        expect(result).to.be.equal(true);
    });
    it('should not get an existing client', function () {
        var exists = clientManager.getClient(200);
        var result = exists ? true : false;
        expect(result).to.be.equal(false);
    });
    it('should add client of type MHSClient', function () {
        var data = { 'client': 'mhs', 'client_type': 'site', 'user_id': 125, 'user_type': 'user', 'channel': name };
        var result = clientManager.getClientType(data, wsClient);
        expect(result.clientType()).to.be.equal('mhs');
    });
});
//# sourceMappingURL=clientManager.spec.js.map