add some ids to homepage tables for testability

This commit is contained in:
burnettk 2023-06-02 10:52:17 -04:00
parent 6eb0ab0286
commit 609e75c108
2 changed files with 14 additions and 4 deletions

View File

@ -98,6 +98,7 @@ type OwnProps = {
showActionsColumn?: boolean;
showLinkToReport?: boolean;
headerElement?: React.ReactElement;
tableHtmlId?: string;
};
interface dateParameters {
@ -119,6 +120,7 @@ export default function ProcessInstanceListTable({
showActionsColumn = false,
showLinkToReport = false,
headerElement,
tableHtmlId,
}: OwnProps) {
let processInstanceApiSearchPath = '/process-instances/for-me';
if (variant === 'all') {
@ -1648,8 +1650,14 @@ export default function ProcessInstanceListTable({
);
});
let tableProps: any = { size: 'lg' };
if (tableHtmlId) {
tableProps = { ...tableProps, id: tableHtmlId };
}
return (
<Table size="lg">
// eslint-disable-next-line react/jsx-props-no-spreading
<Table {...tableProps}>
<TableHead>
<TableRow>
{headers.map((header: any) => (

View File

@ -25,14 +25,14 @@ export default function InProgressInstances() {
Waiting for <strong>{userGroup}</strong>
</h2>
);
const identifierForTable = `waiting-for-${slugifyString(userGroup)}`;
return (
<ProcessInstanceListTable
headerElement={headerElement}
tableHtmlId={identifierForTable}
showLinkToReport
filtersEnabled={false}
paginationQueryParamPrefix={`waiting_for_${slugifyString(
userGroup
).replace('-', '_')}`}
paginationQueryParamPrefix={identifierForTable.replace('-', '_')}
paginationClassName="with-large-bottom-margin"
perPageOptions={[2, 5, 25]}
reportIdentifier="system_report_in_progress_instances_with_tasks"
@ -69,6 +69,7 @@ export default function InProgressInstances() {
<>
<ProcessInstanceListTable
headerElement={startedByMeHeaderElement}
tableHtmlId="open-instances-started-by-me"
filtersEnabled={false}
paginationQueryParamPrefix="open_instances_started_by_me"
perPageOptions={[2, 5, 25]}
@ -82,6 +83,7 @@ export default function InProgressInstances() {
/>
<ProcessInstanceListTable
headerElement={waitingForMeHeaderElement}
tableHtmlId="waiting-for-me"
showLinkToReport
filtersEnabled={false}
paginationQueryParamPrefix="waiting_for_me"