Simplify run format properties, removing duplicate classes. Add values functions, which check and clean up values for specific defined types from the schema
This commit is contained in:
@ -60,12 +60,12 @@ describe("TableCellProperties", () => {
|
||||
it("sets shading", () => {
|
||||
const properties = new TableCellProperties({
|
||||
shading: {
|
||||
fill: "test",
|
||||
color: "000",
|
||||
fill: "ffffff",
|
||||
color: "000000",
|
||||
},
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
expect(tree).to.deep.equal({ "w:tcPr": [{ "w:shd": { _attr: { "w:fill": "test", "w:color": "000" } } }] });
|
||||
expect(tree).to.deep.equal({ "w:tcPr": [{ "w:shd": { _attr: { "w:fill": "ffffff", "w:color": "000000" } } }] });
|
||||
});
|
||||
|
||||
it("should set the TableCellBorders", () => {
|
||||
|
@ -432,8 +432,8 @@ describe("TableCell", () => {
|
||||
const cell = new TableCell({
|
||||
children: [],
|
||||
shading: {
|
||||
fill: "red",
|
||||
color: "blue",
|
||||
fill: "FF0000",
|
||||
color: "0000ff",
|
||||
val: ShadingType.PERCENT_10,
|
||||
},
|
||||
});
|
||||
@ -447,8 +447,8 @@ describe("TableCell", () => {
|
||||
{
|
||||
"w:shd": {
|
||||
_attr: {
|
||||
"w:color": "blue",
|
||||
"w:fill": "red",
|
||||
"w:color": "0000ff",
|
||||
"w:fill": "FF0000",
|
||||
"w:val": "pct10",
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user