(jsonStr: string, expectGrid: Partial<TableNode>[][])
| 4 | import { isDummyType } from "@/lib/table/utils"; |
| 5 | |
| 6 | function checkText(jsonStr: string, expectGrid: Partial<TableNode>[][]) { |
| 7 | const tree = parseJSON(jsonStr); |
| 8 | const tableGrid = buildTableGrid(tree); |
| 9 | const actualGrid: Partial<TableNode>[][] = tableGrid.grid.map((row) => |
| 10 | row.map((cell) => (isDummyType(cell.type) ? { type: cell.type } : { type: cell.type, text: cell.text })), |
| 11 | ); |
| 12 | expect(actualGrid).toEqual(expectGrid); |
| 13 | } |
| 14 | |
| 15 | function checkStyle(jsonStr: string, expectGrid: Partial<TableNode>[][]) { |
| 16 | const tree = parseJSON(jsonStr); |
no test coverage detected