diff --git a/packages/iris-grid/src/IrisGridTreeTableModel.test.ts b/packages/iris-grid/src/IrisGridTreeTableModel.test.ts index 8c29861ed..0fc72a332 100644 --- a/packages/iris-grid/src/IrisGridTreeTableModel.test.ts +++ b/packages/iris-grid/src/IrisGridTreeTableModel.test.ts @@ -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', () => { diff --git a/packages/iris-grid/src/IrisGridTreeTableModel.ts b/packages/iris-grid/src/IrisGridTreeTableModel.ts index eb2c00b5e..432359196 100644 --- a/packages/iris-grid/src/IrisGridTreeTableModel.ts +++ b/packages/iris-grid/src/IrisGridTreeTableModel.ts @@ -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');