import * as WebSocket from 'ws';
import ClientBase from '../clients/clientBase';

var expect = require('chai').expect;
var assert = require('chai').assert;
var sinon = require('sinon');

var name: string = 'test channel';
var data: any = { 'client': 'test', 'client_type':'site', 'user_id': 125, 'user_type': 'user', 'channel': name }
var WebSocketClient = require('websocket').client;
var wsClient = new WebSocketClient();
var client: ClientBase = new ClientBase(data, wsClient);

describe('ClientBase', function () {
  it('should get client data', function () {
    var result = client.getData();
    expect(result.user_id).to.be.equal(125);
  });

  it('should get client type', function () {
    var result = client.clientType();
    expect(result).to.be.equal('test');
  });

  it('should get client object type', function () {
    var result = client.type();
    expect(result).to.be.equal('site');
  });
});
