mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
b7540b5827
This decouples the rest of the server from the client
27 lines
840 B
TypeScript
27 lines
840 B
TypeScript
import {expect} from "chai";
|
|
import constants from "../../../client/js/constants";
|
|
import {describe} from "mocha";
|
|
|
|
describe("client-side constants", function () {
|
|
describe(".colorCodeMap", function () {
|
|
it("should be a non-empty array", function () {
|
|
expect(constants.colorCodeMap).to.be.an("array").of.length(16);
|
|
});
|
|
|
|
it("should be made of pairs of strings", function () {
|
|
constants.colorCodeMap.forEach(([code, name]) => {
|
|
expect(code)
|
|
.to.be.a("string")
|
|
.that.match(/[0-9]{2}/);
|
|
expect(name).to.be.a("string");
|
|
});
|
|
});
|
|
});
|
|
|
|
describe(".timeFormats", function () {
|
|
it("should be objects of strings", function () {
|
|
expect(constants.timeFormats.msgDefault).to.be.an("string").that.is.not.empty;
|
|
expect(constants.timeFormats.msgWithSeconds).to.be.an("string").that.is.not.empty;
|
|
});
|
|
});
|
|
});
|