Skip to content

Commit

Permalink
test: SURVEY-17302 Update test utilities so that they support pinned …
Browse files Browse the repository at this point in the history
…columns
  • Loading branch information
Rainfords committed Jun 28, 2023
1 parent 7198bfb commit cb2a8db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/utils/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ export const findRow = async (rowId: number | string, within?: HTMLElement): Pro
//if this is not wrapped in an act console errors are logged during testing
let row!: HTMLDivElement;
await act(async () => {
row = await findQuick<HTMLDivElement>({ tagName: `div[row-id='${rowId}']:not(:empty)` }, within);
row = await findQuick<HTMLDivElement>({ tagName: `.ag-center-cols-container div[row-id='${rowId}']:not(:empty)` }, within);
const leftCols = await findQuick<HTMLDivElement>(
{ tagName: `.ag-pinned-left-cols-container div[row-id='${rowId}']` },
within,
);
const rightCols = await findQuick<HTMLDivElement>(
{ tagName: `.ag-pinned-right-cols-container div[row-id='${rowId}']` },
within,
);
const combineChildren = [...leftCols.children, ...row.children, ...rightCols.children];
row.replaceChildren(...combineChildren);
});
return row;
};
Expand Down

0 comments on commit cb2a8db

Please sign in to comment.