Add test for extended colors
This commit is contained in:
parent
d0f5d5025e
commit
e1ae339190
@ -485,6 +485,29 @@ describe("parseStyle", () => {
|
|||||||
expect(actual).to.deep.equal(expected);
|
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", () => {
|
it("should parse italic", () => {
|
||||||
const input = "\x1ditalic";
|
const input = "\x1ditalic";
|
||||||
const expected = [{
|
const expected = [{
|
||||||
|
Loading…
Reference in New Issue
Block a user