diff --git a/UNRELEASED.md b/UNRELEASED.md index 108b82afd87..d94e3e985ca 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -6,7 +6,8 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Enhancements -- `EventListener` no longer uses `componentWillUpdate` ([#628](https://github.com/Shopify/polaris-react/pull/628)) +- `TextField` no longer uses `componentWillReceiveProps`([#628](https://github.com/Shopify/polaris-react/pull/628)) +- EventListener`no longer uses`componentWillUpdate` ([#628](https://github.com/Shopify/polaris-react/pull/628)) - Allowed `Icon` to accept a React Node as a source ([#635](https://github.com/Shopify/polaris-react/pull/635)) (thanks to [@mbriggs](https://github.com/mbriggs) for the [original issue](https://github.com/Shopify/polaris-react/issues/449)) ### Bug fixes diff --git a/src/components/TextField/tests/TextField.test.tsx b/src/components/TextField/tests/TextField.test.tsx index 77925e0b38b..d4d707a6199 100644 --- a/src/components/TextField/tests/TextField.test.tsx +++ b/src/components/TextField/tests/TextField.test.tsx @@ -124,7 +124,7 @@ describe('', () => { expect(id).toBeTruthy(); }); - it('updates with new id from props', () => { + it('updates with the new id from props', () => { const id = 'input field'; const textField = mountWithAppProvider( , @@ -132,6 +132,15 @@ describe('', () => { textField.setProps({id}); expect(textField.find('input').prop('id')).toBe(id); }); + + it('updates with the previous id after the id prop has been removed', () => { + const id = 'input field'; + const textField = mountWithAppProvider( + , + ); + textField.setProps({}); + expect(textField.find('input').prop('id')).toBe(id); + }); }); describe('autoComplete', () => {