diff --git a/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx b/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx index 4af7e5858..e17b3c147 100644 --- a/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx +++ b/packages/ui/src/components/InlineEdit/InlineEdit.test.tsx @@ -270,5 +270,19 @@ describe('InlineEdit', () => { expect(preventDefaultSpy).toHaveBeenCalled(); }); + + it('should set the edit icon title', () => { + const wrapper = render(); + + const editButton = wrapper.getByTestId('inline--edit'); + expect(editButton).toHaveAttribute('title', 'Edit'); + }); + + it('should set the text title', () => { + const wrapper = render(); + + const textSpan = wrapper.getByTestId(DATA_TESTID); + expect(textSpan).toHaveAttribute('title', 'Edit'); + }); }); }); diff --git a/packages/ui/src/components/InlineEdit/InlineEdit.tsx b/packages/ui/src/components/InlineEdit/InlineEdit.tsx index ac82ce0e7..33c32cd79 100644 --- a/packages/ui/src/components/InlineEdit/InlineEdit.tsx +++ b/packages/ui/src/components/InlineEdit/InlineEdit.tsx @@ -22,6 +22,8 @@ import { IDataTestID, ValidationResult, ValidationStatus } from '../../models'; import './InlineEdit.scss'; interface IInlineEdit extends IDataTestID { + editTitle?: string; + textTitle?: string; value?: string; validator?: (value: string) => ValidationResult; onChange?: (value: string) => void; @@ -116,6 +118,8 @@ export const InlineEdit: FunctionComponent = (props) => { {isReadOnly ? ( <> = (props) => {