From d69393a3aa29d9c72f29b6e5a5f7ecbf38414afb Mon Sep 17 00:00:00 2001 From: Kerry Date: Mon, 12 Sep 2022 13:06:12 +0200 Subject: [PATCH] Device manager - filter out nulled metadatas in device tile properly (PSG-703) (#9251) * filter out nulled metadatas in device tile properly * remove log --- src/components/views/settings/devices/DeviceTile.tsx | 10 ++++++---- .../settings/__snapshots__/DevicesPanel-test.tsx.snap | 6 ------ .../__snapshots__/CurrentDeviceSection-test.tsx.snap | 4 ---- .../devices/__snapshots__/DeviceTile-test.tsx.snap | 6 ------ .../__snapshots__/SelectableDeviceTile-test.tsx.snap | 1 - .../user/__snapshots__/SessionManagerTab-test.tsx.snap | 6 ------ 6 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/components/views/settings/devices/DeviceTile.tsx b/src/components/views/settings/devices/DeviceTile.tsx index 73ee17b2f4..a23e1586db 100644 --- a/src/components/views/settings/devices/DeviceTile.tsx +++ b/src/components/views/settings/devices/DeviceTile.tsx @@ -99,10 +99,12 @@ const DeviceTile: React.FC = ({ device, children, onClick }) =>
{ metadata.map(({ id, value }, index) => - - { !!index && ' · ' } - - , + !!value + ? + { !!index && ' · ' } + + + : null, ) }
diff --git a/test/components/views/settings/__snapshots__/DevicesPanel-test.tsx.snap b/test/components/views/settings/__snapshots__/DevicesPanel-test.tsx.snap index f0c569a82f..2f2f3a7773 100644 --- a/test/components/views/settings/__snapshots__/DevicesPanel-test.tsx.snap +++ b/test/components/views/settings/__snapshots__/DevicesPanel-test.tsx.snap @@ -141,8 +141,6 @@ exports[` renders device panel with devices 1`] = ` > Unverified - · - ·
renders device panel with devices 1`] = ` > Unverified - · - ·
renders device panel with devices 1`] = ` > Unverified - · - ·
renders device and correct security card when > Unverified - · - ·
renders device and correct security card when > Unverified - · - ·
renders a device with no metadata 1`] = ` > Unverified - · - ·
renders a verified device with no metadata 1`] = ` > Unverified - · - ·
renders display name with a tooltip 1`] = ` > Unverified - · - ·
renders unselected device tile with checkbox 1 Unverified · - · diff --git a/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap index ad796130e6..87f9aab952 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap @@ -83,8 +83,6 @@ exports[` renders current session section with a verified s > Verified - · - ·
renders current session section with an unverifie > Unverified - · - ·
sets device verification status correctly 1`] = ` > Verified - · - ·