react-bootstrap-table2
react-bootstrap-table2 copied to clipboard
Ability to use custom data-* attributes
Expected behavior Ability to pass in or auto generate data-testids for the table pagination elements, filter inputs, etc so it's easier to do E2E testing.
Actual behavior Not able to pass in custom data attributes to each element.
Example:
<PaginationTotalStandalone {...paginationProps} />
<BootstrapTable
keyField="systemId"
id="result-table"
data-automation-id="result-table-for-automation"
data={this.state.licenseManagerResult}
columns={columns}
wrapperClasses="table-responsive mt-2"
filter={filterFactory()}
defaultSorted={defaultSorted}
striped
hover
bootstrap4
selectRow={selectRow}
rowEvents={rowEvents}
{...paginationTableProps}
/>
<PaginationListStandalone {...paginationProps} />
This shows up as
<table id="result-table" class="table table-striped table-hover table-bordered">
Expected:
<table id="result-table" data-automation-id="result-table-for-automation" class="table table-striped table-hover table-bordered">
+1
This is a great idea. Leveraging data-* attributes in rows as well is going to be beneficial.
+1; has this been implemented already?