thelounge/test/models/network.js
2016-10-09 17:55:37 -04:00

39 lines
967 B
JavaScript

"use strict";
var expect = require("chai").expect;
var Chan = require("../../src/models/chan");
var Network = require("../../src/models/network");
describe("Network", function() {
describe("#export()", function() {
it("should produce an valid object", function() {
var network = new Network({name: "networkName"});
network.setNick("chillin`");
network.channels.push(new Chan({name: "#thelounge"}));
network.channels.push(new Chan({name: "&foobar"}));
network.channels.push(new Chan({name: "Lobby", type: Chan.Type.LOBBY}));
network.channels.push(new Chan({name: "PrivateChat", type: Chan.Type.QUERY}));
expect(network.export()).to.deep.equal({
name: "networkName",
host: "",
port: 6667,
tls: false,
password: "",
username: "",
realname: "",
commands: [],
nick: "chillin`",
ip: null,
hostname: null,
channels: [
{name: "#thelounge"},
{name: "&foobar"},
]
});
});
});
});