From ac5ba62fda43b9dad792c793d40a3c745fd24923 Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Mon, 27 Nov 2023 23:59:40 +0530 Subject: [PATCH] fixed translations --- src/components/UI/Pager/Pager.tsx | 8 +++++--- .../InteractiveMessage/InteractiveMessage.test.tsx | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/UI/Pager/Pager.tsx b/src/components/UI/Pager/Pager.tsx index 598ba2697..4ce051961 100644 --- a/src/components/UI/Pager/Pager.tsx +++ b/src/components/UI/Pager/Pager.tsx @@ -45,10 +45,14 @@ const collapsedRowData = (dataObj: any, columnStyles: any, recordId: any) => { ); } + console.log(dataObj); const additionalRowInformation = Object.keys(dataObj).map((key, index) => { const rowIdentifier = `collapsedRowData-${recordId}-${index}`; + // This is for location translation type where the text is inside body. + const body = typeof dataObj[key].body === 'string' ? dataObj[key].body : dataObj[key].body.text; + return ( @@ -58,11 +62,9 @@ const collapsedRowData = (dataObj: any, columnStyles: any, recordId: any) => {
-

{dataObj[key].body}

+

{body}

- -
); }); diff --git a/src/containers/InteractiveMessage/InteractiveMessage.test.tsx b/src/containers/InteractiveMessage/InteractiveMessage.test.tsx index 720f4a25a..0d44d2d14 100644 --- a/src/containers/InteractiveMessage/InteractiveMessage.test.tsx +++ b/src/containers/InteractiveMessage/InteractiveMessage.test.tsx @@ -265,9 +265,12 @@ describe('location request message', () => { expect(interactiveType.querySelector('input')).toHaveValue('Location request'); }); - fireEvent.change(screen.getAllByTestId('outlinedInput')[0]?.querySelector('input'), { - target: { value: 'Section 1' }, - }); + fireEvent.change( + screen.getAllByTestId('outlinedInput')[0]?.querySelector('input') as HTMLElement, + { + target: { value: 'Section 1' }, + } + ); // have send location in simulator preview await waitFor(() => {