diff --git a/CHANGELOG.md b/CHANGELOG.md index d3569c5ea32..034c3b6bb15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Added `data-test-subj` support for basic and in-memory tables' actions ([#2353](https://github.com/elastic/eui/pull/2353)) + **Bug fixes** - Fixed spacing of `EuiFormErrorText` to match `EuiFormHelpText` ([#2354](https://github.com/elastic/eui/pull/2354)) diff --git a/src-docs/src/views/tables/actions/actions.js b/src-docs/src/views/tables/actions/actions.js index 55552bf2845..c3d9340e912 100644 --- a/src-docs/src/views/tables/actions/actions.js +++ b/src-docs/src/views/tables/actions/actions.js @@ -163,6 +163,7 @@ export class Table extends Component { description: 'Clone this user', icon: 'copy', onClick: this.cloneUser, + 'data-test-subj': 'action-clone', }, { name: 'Delete', @@ -172,6 +173,7 @@ export class Table extends Component { type: 'icon', onClick: this.deleteUser, isPrimary: true, + 'data-test-subj': 'action-delete', }, { name: 'Edit', @@ -180,6 +182,7 @@ export class Table extends Component { icon: 'pencil', type: 'icon', onClick: () => {}, + 'data-test-subj': 'action-edit', }, { name: 'Share', @@ -188,6 +191,7 @@ export class Table extends Component { icon: 'share', type: 'icon', onClick: () => {}, + 'data-test-subj': 'action-share', }, ]; } else { @@ -212,6 +216,7 @@ export class Table extends Component { type: 'icon', href: 'https://elastic.co', target: '_blank', + 'data-test-subj': 'action-outboundlink', }, ]; } diff --git a/src-docs/src/views/tables/basic/props_info.js b/src-docs/src/views/tables/basic/props_info.js index 834274aaceb..0dc3d730f1b 100644 --- a/src-docs/src/views/tables/basic/props_info.js +++ b/src-docs/src/views/tables/basic/props_info.js @@ -404,6 +404,12 @@ export const propsInfo = { required: false, type: { name: 'string (must be one of the supported button colors)' }, }, + 'data-test-subj': { + description: + "Applies a data-test-subj attribute to the action's DOM node", + required: false, + type: { name: 'string' }, + }, }, }, }, diff --git a/src/components/basic_table/__snapshots__/collapsed_item_actions.test.js.snap b/src/components/basic_table/__snapshots__/collapsed_item_actions.test.js.snap index cba30915d37..c461186c7c1 100644 --- a/src/components/basic_table/__snapshots__/collapsed_item_actions.test.js.snap +++ b/src/components/basic_table/__snapshots__/collapsed_item_actions.test.js.snap @@ -14,6 +14,7 @@ exports[`CollapsedItemActions render 1`] = `