Skip to content

Commit

Permalink
- update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-goldstein committed May 17, 2022
1 parent eb21b56 commit 4938d60
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,26 @@ const ColumnHeaderComponent: React.FC<ColumneHeaderProps> = ({
const onColumnSort = useCallback(
(sortDirection: Direction) => {
const columnId = header.id;
const columnType = header.type ?? '';
const esTypes = header.esTypes ?? [];
const headerIndex = sort.findIndex((col) => col.columnId === columnId);
const newSort =
headerIndex === -1
? [
...sort,
{
columnId,
columnType: `${header.type}`,
columnType,
esTypes,
sortDirection,
},
]
: [
...sort.slice(0, headerIndex),
{
columnId,
columnType: `${header.type}`,
columnType,
esTypes,
sortDirection,
},
...sort.slice(headerIndex + 1),
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('ColumnHeaders', () => {
sort: [
{
columnId: '@timestamp',
columnType: 'number',
columnType: 'date',
sortDirection: Direction.asc,
},
{ columnId: 'host.name', columnType: 'text', sortDirection: Direction.asc },
Expand Down

0 comments on commit 4938d60

Please sign in to comment.