Skip to content

Commit

Permalink
add data-test-subj where possible on SO management table (#60226)
Browse files Browse the repository at this point in the history
* add data-test-subj where possible

* add per-action dts

* update snapshots
  • Loading branch information
pgayvallet authored Mar 18, 2020
1 parent 45f59f7 commit d466cc9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class Table extends PureComponent {
{ defaultMessage: 'Type of the saved object' }
),
sortable: false,
'data-test-subj': 'savedObjectsTableRowType',
render: (type, object) => {
return (
<EuiToolTip position="top" content={getSavedObjectLabel(type)}>
Expand All @@ -201,6 +202,7 @@ export class Table extends PureComponent {
),
dataType: 'string',
sortable: false,
'data-test-subj': 'savedObjectsTableRowTitle',
render: (title, object) => {
const { path } = object.meta.inAppUrl || {};
const canGoInApp = this.props.canGoInApp(object);
Expand Down Expand Up @@ -230,6 +232,7 @@ export class Table extends PureComponent {
icon: 'inspect',
onClick: object => goInspectObject(object),
available: object => !!object.meta.editUrl,
'data-test-subj': 'savedObjectsTableAction-inspect',
},
{
name: i18n.translate(
Expand All @@ -246,10 +249,12 @@ export class Table extends PureComponent {
type: 'icon',
icon: 'kqlSelector',
onClick: object => onShowRelationships(object),
'data-test-subj': 'savedObjectsTableAction-relationships',
},
...this.extraActions.map(action => {
return {
...action.euiAction,
'data-test-subj': `savedObjectsTableAction-${action.id}`,
onClick: object => {
this.setState({
activeAction: action,
Expand Down Expand Up @@ -372,6 +377,9 @@ export class Table extends PureComponent {
pagination={pagination}
selection={selection}
onChange={onTableChange}
rowProps={item => ({
'data-test-subj': `savedObjectsTableRow row-${item.id}`,
})}
/>
</div>
</Fragment>
Expand Down

0 comments on commit d466cc9

Please sign in to comment.