Limit the list of supported highlight colors (#2522)
* Limit the list of supported highlight colors * Fix tests: use fixed highlight color values --------- Co-authored-by: ilyasogonov <sogonov.ilya@customscard.ru>
This commit is contained in:
@ -4,6 +4,7 @@ import { Formatter } from "@export/formatter";
|
||||
|
||||
import { AlignmentType, EmphasisMarkType, TabStopPosition } from "../paragraph";
|
||||
import { UnderlineType } from "../paragraph/run/underline";
|
||||
import { HighlightColor } from "../paragraph/run/properties";
|
||||
import { ShadingType } from "../shading";
|
||||
import { AbstractNumbering } from "./abstract-numbering";
|
||||
import { LevelFormat, LevelSuffix } from "./level";
|
||||
@ -2048,23 +2049,23 @@ describe("AbstractNumbering", () => {
|
||||
|
||||
const highlightTests = [
|
||||
{
|
||||
highlight: "005599",
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "005599" } } }, { "w:highlightCs": { _attr: { "w:val": "005599" } } }],
|
||||
highlight: HighlightColor.YELLOW,
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "yellow" } } }, { "w:highlightCs": { _attr: { "w:val": "yellow" } } }],
|
||||
},
|
||||
{
|
||||
highlight: "005599",
|
||||
highlight: HighlightColor.YELLOW,
|
||||
highlightComplexScript: true,
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "005599" } } }, { "w:highlightCs": { _attr: { "w:val": "005599" } } }],
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "yellow" } } }, { "w:highlightCs": { _attr: { "w:val": "yellow" } } }],
|
||||
},
|
||||
{
|
||||
highlight: "005599",
|
||||
highlight: HighlightColor.YELLOW,
|
||||
highlightComplexScript: false,
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "005599" } } }],
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "yellow" } } }],
|
||||
},
|
||||
{
|
||||
highlight: "005599",
|
||||
highlight: HighlightColor.YELLOW,
|
||||
highlightComplexScript: "550099",
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "005599" } } }, { "w:highlightCs": { _attr: { "w:val": "550099" } } }],
|
||||
expected: [{ "w:highlight": { _attr: { "w:val": "yellow" } } }, { "w:highlightCs": { _attr: { "w:val": "550099" } } }],
|
||||
},
|
||||
];
|
||||
highlightTests.forEach(({ highlight, highlightComplexScript, expected }) => {
|
||||
|
Reference in New Issue
Block a user