react-bootstrap-table2 icon indicating copy to clipboard operation
react-bootstrap-table2 copied to clipboard

Ability to use custom data-* attributes

Open MetalWing opened this issue 5 years ago • 3 comments

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">

MetalWing avatar Aug 18 '20 14:08 MetalWing

+1

paolocattani avatar Dec 17 '20 11:12 paolocattani

This is a great idea. Leveraging data-* attributes in rows as well is going to be beneficial.

iotheo avatar Jul 07 '21 09:07 iotheo

+1; has this been implemented already?

yashaRO avatar Mar 30 '22 06:03 yashaRO