mirror of
https://github.com/thelounge/thelounge
synced 2024-11-24 04:53:09 +00:00
23 lines
725 B
JavaScript
23 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;
|
|
});
|
|
});
|