import React from "react";
import { assert } from "chai";
import { DOCXSentenceChildrenRun, HTMLSentenceChildrenRun } from "./sentenceChildrenRun";
import loadEL from "../../node/el/loadEL";
import type * as std from "../../law/std";
import { renderToStaticMarkup } from "../common";
import formatXML from "../../util/formatXml";
import htmlCSS from "./htmlCSS";
import path from "path";
import { promisify } from "util";
import fs from "fs";
import ensureTempTestDir from "../../../test/ensureTempTestDir";
import { renderDocxAsync } from "../common/docx/file";
import { w } from "../common/docx/tags";
describe("Test HTML sentenceChildrenRun", () => {
/* eslint-disable no-irregular-whitespace */
it("Success case", async () => {
const input = loadEL({
tag: "Sentence",
attr: {},
children: [
{
tag: "__Text",
attr: {},
children: ["この法律において"],
},
{
tag: "__Parentheses",
attr: {
depth: "1",
type: "square",
},
children: [
{
tag: "__PStart",
attr: {
type: "square",
},
children: ["「"],
},
{
tag: "__PContent",
attr: { type: "square" },
children: [
{
tag: "__Text",
attr: {},
children: ["スパイクタイヤ"],
},
],
},
{
tag: "__PEnd",
attr: { "type": "square" },
children: ["」"],
},
],
},
{
tag: "__Text",
attr: {},
children: ["とは、積雪又は凍結の状態にある路面において滑ることを防止するために金属"],
},
{
tag: "Ruby",
attr: {},
children: [
{
tag: "__Text",
attr: {},
children: ["鋲"],
},
{
tag: "Rt",
attr: {},
children: [
{
tag: "__Text",
attr: {},
children: ["びよう"],
},
],
},
],
},
{
tag: "__Text",
attr: {},
children: ["その他これに類する物をその接地部に固定したタイヤをいう。"],
},
],
}) as std.Sentence;
const expectedHTML = /*html*/`\
この法律において「スパイクタイヤ」とは、積雪又は凍結の状態にある路面において滑ることを防止するために金属鋲その他これに類する物をその接地部に固定したタイヤをいう。
`;
const element =