Skip to content

Commit 2663e4d

Browse files
committed
fix unit test
1 parent a9b4194 commit 2663e4d

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

packages/iris-grid/src/sidebar/aggregations/Aggregations.test.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { render, type RenderResult, screen } from '@testing-library/react';
33
import userEvent from '@testing-library/user-event';
4+
import type { dh as DhType } from '@deephaven/jsapi-types';
45
import Aggregations, { type Aggregation } from './Aggregations';
56
import AggregationOperation from './AggregationOperation';
67
import { SELECTABLE_OPTIONS } from './AggregationUtils';
@@ -13,6 +14,25 @@ function makeAggregation({
1314
return { operation, selected, invert };
1415
}
1516

17+
const MOCK_DH = {
18+
AggregationOperation: {
19+
SUM: 'SUM',
20+
ABS_SUM: 'ABS_SUM',
21+
MIN: 'MIN',
22+
MAX: 'MAX',
23+
VAR: 'VAR',
24+
AVG: 'AVG',
25+
MEDIAN: 'MEDIAN',
26+
STD: 'STD',
27+
FIRST: 'FIRST',
28+
LAST: 'LAST',
29+
COUNT_DISTINCT: 'COUNT_DISTINCT',
30+
DISTINCT: 'DISTINCT',
31+
COUNT: 'COUNT',
32+
UNIQUE: 'UNIQUE',
33+
},
34+
} as unknown as typeof DhType;
35+
1636
function mountAggregations({
1737
settings = { aggregations: [] as Aggregation[], showOnTop: false },
1838
onChange = jest.fn(),
@@ -25,6 +45,7 @@ function mountAggregations({
2545
onChange={onChange}
2646
onEdit={onEdit}
2747
isRollup={isRollup}
48+
dh={MOCK_DH}
2849
/>
2950
);
3051
}

0 commit comments

Comments
 (0)