From d27bd15cd1a65ae9f0fbadcb4b5242cb15a3dd60 Mon Sep 17 00:00:00 2001 From: Ashik Meerankutty Date: Sun, 12 Apr 2020 22:30:12 +0530 Subject: [PATCH 1/3] added test with null value --- src/components/i18n/i18n.test.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/i18n/i18n.test.tsx b/src/components/i18n/i18n.test.tsx index deb055ae22f..dce59a41238 100644 --- a/src/components/i18n/i18n.test.tsx +++ b/src/components/i18n/i18n.test.tsx @@ -38,6 +38,13 @@ describe('EuiI18n', () => { expect(renderCallback).toHaveBeenCalledWith(values); }); + + it('renders when value is null', () => { + const component = mount( + + ); + expect(component).toMatchSnapshot(); + }); }); describe('render prop with single token', () => { From 8b7460c34acdea6bf4190f2b1e5dd29dc37d9663 Mon Sep 17 00:00:00 2001 From: Ashik Meerankutty Date: Sun, 12 Apr 2020 22:31:35 +0530 Subject: [PATCH 2/3] fixed i18n null value error --- .../i18n/__snapshots__/i18n.test.tsx.snap | 16 ++++++++++++++++ src/components/i18n/i18n_util.tsx | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/i18n/__snapshots__/i18n.test.tsx.snap b/src/components/i18n/__snapshots__/i18n.test.tsx.snap index 19f03d22b70..462989707db 100644 --- a/src/components/i18n/__snapshots__/i18n.test.tsx.snap +++ b/src/components/i18n/__snapshots__/i18n.test.tsx.snap @@ -135,6 +135,22 @@ exports[`EuiI18n default rendering rendering to dom renders a string with placeh `; +exports[`EuiI18n default rendering rendering to dom renders when value is null 1`] = ` + + + +`; + exports[`EuiI18n reading values from context mappingFunc calls the mapping function with the source string 1`] = ` Date: Sun, 12 Apr 2020 22:40:45 +0530 Subject: [PATCH 3/3] cl --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89ef9741b53..6fdb3b08e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ No public interface changes since `22.5.0`. **Bug Fixes** +- Fixed EuiI8n hasPropName utility errors on null values ([#3303](https://github.com/elastic/eui/pull/3303)) - Fixed the inline styles being overwritten by consumer-passed inline styles in EuiBadge ([#3284](https://github.com/elastic/eui/pull/3284)) ## [`22.4.0`](https://github.com/elastic/eui/tree/v22.4.0)