(jsonStr: string, expectGrid: Partial<TableNode>[][])
| 13 | } |
| 14 | |
| 15 | function checkStyle(jsonStr: string, expectGrid: Partial<TableNode>[][]) { |
| 16 | const tree = parseJSON(jsonStr); |
| 17 | const tableGrid = buildTableGrid(tree); |
| 18 | const actualGrid: Partial<TableNode>[][] = tableGrid.grid.map((row) => |
| 19 | row.map((cell) => { |
| 20 | const nd: Partial<TableNode> = { |
| 21 | x: cell.x, |
| 22 | width: cell.width, |
| 23 | type: cell.type, |
| 24 | }; |
| 25 | if (!isDummyType(cell.type)) { |
| 26 | nd.text = cell.text; |
| 27 | } |
| 28 | return nd; |
| 29 | }), |
| 30 | ); |
| 31 | expect(actualGrid).toEqual(expectGrid); |
| 32 | } |
| 33 | |
| 34 | describe("buildTableGrid", () => { |
| 35 | test("value", () => { |
no test coverage detected