Highlighting

This commit is contained in:
Forman
2019-08-05 13:42:45 +03:00
parent 9e8d67c4a9
commit fa710d1ba6
12 changed files with 285 additions and 2 deletions

View File

@ -115,6 +115,54 @@ describe("Run", () => {
});
});
describe("#highlight()", () => {
it("it should add highlight to the properties", () => {
run.highlight("005599");
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{
"w:rPr": [
{ "w:highlight ": { _attr: { "w:val": "005599" } } },
{
"w:highlightCs": {
_attr: {
"w:val": "005599",
},
},
},
],
},
],
});
});
});
describe("#shadow()", () => {
it("it should add shadow to the properties", () => {
run.shadow("pct10", "00FFFF", "FF0000");
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{
"w:rPr": [
{ "w:shd ": { _attr: { "w:val": "pct10", "w:fill": "00FFFF", "w:color": "FF0000" } } },
{
"w:shdCs": {
_attr: {
"w:val": "pct10",
"w:fill": "00FFFF",
"w:color": "FF0000",
},
},
},
],
},
],
});
});
});
describe("#break()", () => {
it("it should add break to the run", () => {
run.break();