From e1ae339190e370866b96fc188667049206e7bb60 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 12 Dec 2017 20:06:37 +0200 Subject: [PATCH] Add test for extended colors --- .../handlebars/ircmessageparser/parseStyle.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/client/js/libs/handlebars/ircmessageparser/parseStyle.js b/test/client/js/libs/handlebars/ircmessageparser/parseStyle.js index 525851c2..1560cddd 100644 --- a/test/client/js/libs/handlebars/ircmessageparser/parseStyle.js +++ b/test/client/js/libs/handlebars/ircmessageparser/parseStyle.js @@ -485,6 +485,29 @@ describe("parseStyle", () => { expect(actual).to.deep.equal(expected); }); + it("should parse extended colors", () => { + const input = "\x0370,99some text"; + const expected = [{ + textColor: 70, + bgColor: 99, + hexColor: undefined, + hexBgColor: undefined, + bold: false, + italic: false, + underline: false, + strikethrough: false, + monospace: false, + text: "some text", + + start: 0, + end: 9, + }]; + + const actual = parseStyle(input); + + expect(actual).to.deep.equal(expected); + }); + it("should parse italic", () => { const input = "\x1ditalic"; const expected = [{