thelounge/test/client/js/libs/handlebars/modesTest.js
2017-11-30 20:33:23 -05:00

24 lines
725 B
JavaScript

"use strict";
const expect = require("chai").expect;
const modes = require("../../../../../client/js/libs/handlebars/modes");
describe("modes Handlebars helper", function() {
it("should return text modes based on symbols", function() {
expect(modes("~")).to.equal("owner");
expect(modes("&")).to.equal("admin");
expect(modes("!")).to.equal("admin");
expect(modes("@")).to.equal("op");
expect(modes("%")).to.equal("half-op");
expect(modes("+")).to.equal("voice");
});
it("should return no special mode when given an empty string", function() {
expect(modes("")).to.equal("normal");
});
it("should return nothing if the symbol does not exist", function() {
expect(modes("?")).to.be.undefined;
});
});