Skip to content

Commit

Permalink
Add more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vbabich committed Sep 23, 2024
1 parent 68aa65e commit a15843a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/iris-grid/src/IrisGridTreeTableModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ describe('IrisGridTreeTableModel virtual columns', () => {
expect(model.columns).toEqual(expected);
}
);

test.each([
['filter', 'Filter'],
['sort', 'Sort'],
['formatColor', 'Color'],
['get', 'get'],
['getFormat', 'getFormat'],
['formatNumber', 'formatNumber'],
['formatDate', 'formatDate'],
])('virtual column method %s is not implemented', (method, displayName) => {
const groupedColumns = columns.slice(0, 2);
const table = irisGridTestUtils.makeTreeTable(columns, groupedColumns);
const model = new IrisGridTreeTableModel(dh, table);
expect(() => model.columns[0][method]()).toThrow(
new Error(`${displayName} not implemented for virtual column`)
);
});
});

describe('IrisGridTreeTableModel layoutHints', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/iris-grid/src/IrisGridTreeTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const VirtualGroupColumn = Object.freeze({
throw new Error('Filter not implemented for virtual column');
},
sort: () => {
throw new Error('Sort not implemented virtual column');
throw new Error('Sort not implemented for virtual column');
},
formatColor: () => {
throw new Error('Color not implemented for virtual column');
Expand Down

0 comments on commit a15843a

Please sign in to comment.