diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx index abb184bcb4382..169f12c3487c4 100644 --- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx @@ -241,7 +241,7 @@ describe('SpacesGridPage', () => { wrapper.update(); const activeRow = wrapper.find('[data-test-subj="spacesListTableRow-custom-2"]'); - const switchAction = activeRow.find('EuiButtonIcon[data-test-subj="Custom 2-switchSpace"]'); + const switchAction = activeRow.find('EuiButtonIcon[data-test-subj="custom-2-switchSpace"]'); expect(switchAction.prop('isDisabled')).toBe(true); }); @@ -273,7 +273,7 @@ describe('SpacesGridPage', () => { wrapper.update(); const nonActiveRow = wrapper.find('[data-test-subj="spacesListTableRow-default"]'); - const switchAction = nonActiveRow.find('EuiButtonIcon[data-test-subj="Default-switchSpace"]'); + const switchAction = nonActiveRow.find('EuiButtonIcon[data-test-subj="default-switchSpace"]'); expect(switchAction.prop('isDisabled')).toBe(false); }); diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx index 3049fb00d8977..586992c1b6b48 100644 --- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx @@ -430,7 +430,7 @@ export class SpacesGridPage extends Component { reactRouterNavigate(this.props.history, this.getEditSpacePath(rowRecord)).href, onClick: (rowRecord) => reactRouterNavigate(this.props.history, this.getEditSpacePath(rowRecord)).onClick, - 'data-test-subj': (rowRecord) => `${rowRecord.name}-editSpace`, + 'data-test-subj': (rowRecord) => `${rowRecord.id}-editSpace`, }, { isPrimary: true, @@ -438,7 +438,7 @@ export class SpacesGridPage extends Component { defaultMessage: 'Switch', }), description: (rowRecord) => - activeSpace?.name !== rowRecord.name + activeSpace?.id !== rowRecord.id ? i18n.translate( 'xpack.spaces.management.spacesGridPage.switchSpaceActionDescription', { @@ -462,8 +462,8 @@ export class SpacesGridPage extends Component { rowRecord.id, `${ENTER_SPACE_PATH}?next=/app/management/kibana/spaces/` ), - enabled: (rowRecord) => activeSpace?.name !== rowRecord.name, - 'data-test-subj': (rowRecord) => `${rowRecord.name}-switchSpace`, + enabled: (rowRecord) => activeSpace?.id !== rowRecord.id, + 'data-test-subj': (rowRecord) => `${rowRecord.id}-switchSpace`, }, { name: i18n.translate('xpack.spaces.management.spacesGridPage.deleteActionName', { @@ -487,7 +487,7 @@ export class SpacesGridPage extends Component { color: 'danger', onClick: (rowRecord: Space) => this.onDeleteSpaceClick(rowRecord), enabled: (rowRecord: Space) => !isReservedSpace(rowRecord), - 'data-test-subj': (rowRecord) => `${rowRecord.name}-deleteSpace`, + 'data-test-subj': (rowRecord) => `${rowRecord.id}-deleteSpace`, }, ], });