Skip to content

Commit

Permalink
fix: findRow was erroring if no pinned columns present (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
dclinz authored Aug 31, 2023
1 parent 479b609 commit 9de8c68
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/utils/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ export const findRow = async (rowId: number | string, within?: HTMLElement): Pro
{ tagName: `.ag-center-cols-container div[row-id='${rowId}']:not(:empty)` },
within,
);
const leftCols = await findQuick<HTMLDivElement>(
let combineChildren = [...row.children];

const leftCols = queryQuick<HTMLDivElement>(
{ tagName: `.ag-pinned-left-cols-container div[row-id='${rowId}']` },
within,
);
const rightCols = await findQuick<HTMLDivElement>(
if (leftCols) combineChildren = [...leftCols.children, ...combineChildren];

const rightCols = queryQuick<HTMLDivElement>(
{ tagName: `.ag-pinned-right-cols-container div[row-id='${rowId}']` },
within,
);
const combineChildren = [...leftCols.children, ...row.children, ...rightCols.children];
if (rightCols) combineChildren = [...rightCols.children, ...combineChildren];

row.replaceChildren(...combineChildren);
});
return row;
Expand Down

0 comments on commit 9de8c68

Please sign in to comment.