import { Assert, UnitTest } from '@ephox/bedrock-client'; import { Remove, SugarElement } from '@ephox/sugar'; import * as TableGridSize from 'ephox/snooker/api/TableGridSize'; UnitTest.test('Table grid size test', () => { const testGridSize = (html: string, expectedColumnCount: number, expectedRowCount: number) => { const tbl = SugarElement.fromHtml(html); const size = TableGridSize.getGridSize(tbl); Assert.eq('Should be expected column count', expectedColumnCount, size.columns); Assert.eq('Should be expected row count', expectedRowCount, size.rows); Remove.remove(tbl); }; testGridSize('
', 1, 1); testGridSize('
', 2, 1); testGridSize('
', 1, 2); testGridSize('
', 2, 2); });