2016-03-16 05:41:19 +00:00
|
|
|
"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"});
|
2016-05-12 11:30:23 +00:00
|
|
|
network.setNick("chillin`");
|
2016-03-16 05:41:19 +00:00
|
|
|
network.channels.push(new Chan({name: "#thelounge"}));
|
|
|
|
network.channels.push(new Chan({name: "&foobar"}));
|
2016-06-19 17:12:42 +00:00
|
|
|
network.channels.push(new Chan({name: "Lobby", type: Chan.Type.LOBBY}));
|
|
|
|
network.channels.push(new Chan({name: "PrivateChat", type: Chan.Type.QUERY}));
|
2016-03-16 05:41:19 +00:00
|
|
|
|
|
|
|
expect(network.export()).to.deep.equal({
|
|
|
|
name: "networkName",
|
|
|
|
host: "",
|
|
|
|
port: 6667,
|
|
|
|
tls: false,
|
|
|
|
password: "",
|
|
|
|
username: "",
|
|
|
|
realname: "",
|
|
|
|
commands: [],
|
2016-05-12 11:30:23 +00:00
|
|
|
nick: "chillin`",
|
2016-04-03 05:12:49 +00:00
|
|
|
ip: null,
|
2016-06-19 17:12:42 +00:00
|
|
|
hostname: null,
|
|
|
|
channels: [
|
|
|
|
{"name": "#thelounge"},
|
|
|
|
{"name": "&foobar"},
|
|
|
|
]
|
2016-03-16 05:41:19 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|