import React from "react"; import { assert } from "chai"; import loadEL from "../../node/el/loadEL"; import type * as std from "../../law/std"; import { DOCXNoteLike, HTMLNoteLike } from "./noteLike"; import { renderToStaticMarkup } from "../common"; import { renderDocxAsync } from "../common/docx/file"; import ensureTempTestDir from "../../../test/ensureTempTestDir"; import path from "path"; import fs from "fs"; import formatXML from "../../util/formatXml"; import htmlCSS from "./htmlCSS"; import { promisify } from "util"; describe("Test HTML noteLike", () => { /* eslint-disable no-irregular-whitespace */ it("Success case", async () => { const input = loadEL({ tag: "NoteStruct", attr: {}, children: [ { tag: "Remarks", attr: {}, children: [ { tag: "RemarksLabel", attr: {}, children: ["備考"], }, { tag: "Sentence", attr: {}, children: ["備考文1"], }, ], }, { tag: "Note", attr: {}, children: [ { tag: "Table", attr: {}, children: [ { tag: "TableHeaderRow", attr: {}, children: [ { tag: "TableHeaderColumn", attr: {}, children: ["項"], }, { tag: "TableHeaderColumn", attr: {}, children: ["種名"], }, ], }, { tag: "TableRow", attr: {}, children: [ { tag: "TableColumn", attr: { colspan: "2", }, children: [ { tag: "Column", attr: {}, children: [ { tag: "Sentence", attr: {}, children: ["(1)"], }, ], }, { tag: "Column", attr: {}, children: [ { tag: "Sentence", attr: {}, children: ["かも科"], }, ], }, ], }, ], }, { tag: "TableRow", attr: {}, children: [ { tag: "TableColumn", attr: {}, children: [ { tag: "Sentence", attr: {}, children: ["1"], }, ], }, { tag: "TableColumn", attr: {}, children: [ { tag: "Sentence", attr: {}, children: ["シジュウカラガン"], }, ], }, ], }, ], }, ], }, { tag: "Remarks", attr: {}, children: [ { tag: "Sentence", attr: {}, children: ["備考文2"], }, ], }, ], }) as std.NoteLike; const expectedHTML = /*html*/`\
|
項
|
種名
|
|---|---|
|
(1)
かも科
|
|
|
1
|
シジュウカラガン
|