From c6e42352c3702fba1079a1eb686f3a068c71d24e Mon Sep 17 00:00:00 2001 From: nowgnuesLee <192685612+nowgnuesLee@users.noreply.github.com> Date: Tue, 9 Dec 2025 09:49:27 +0000 Subject: [PATCH] feat(FR-1764): add data-testid to agent live stats to hide it easily (#4773) resolves #4772 (FR-1764) In this pr, I added data-testid attribute to agent live stat to hide it easily. **Checklist:** (if applicable) - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after --- react/src/components/AgentList.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/react/src/components/AgentList.tsx b/react/src/components/AgentList.tsx index 82d574e0bd..75e2196219 100644 --- a/react/src/components/AgentList.tsx +++ b/react/src/components/AgentList.tsx @@ -482,6 +482,7 @@ const AgentList: React.FC = ({ // CPU justify="between" style={{ minWidth: 200, width: '100%' }} + data-testid="live-stat-cpu" > {mergedResourceSlots?.cpu?.human_readable_name} @@ -501,6 +502,7 @@ const AgentList: React.FC = ({ // MEM justify="between" style={{ minWidth: 200, width: '100%' }} + data-testid="live-stat-mem" > {mergedResourceSlots?.mem?.human_readable_name} @@ -533,6 +535,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {mergedResourceSlots?.[deviceName]?.human_readable_name} @@ -574,6 +577,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {mergedResourceSlots?.[deviceName]?.human_readable_name} @@ -619,6 +623,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {`${humanReadableName}(power)`} {`${toFixedFloorWithoutTrailingZeros(parsedValue.node[statKey]?.current, 2)} ${parsedValue.node[statKey].unit_hint}`} @@ -636,6 +641,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {`${humanReadableName}(temp)`} {`${toFixedFloorWithoutTrailingZeros(parsedValue.node[statKey]?.current, 2)} °C`} @@ -653,6 +659,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {statKey === 'net_rx' ? 'Net Rx' : 'Net Tx'} @@ -669,6 +676,7 @@ const AgentList: React.FC = ({ justify="between" style={{ minWidth: 200, width: '100%' }} gap="xxs" + data-testid={`live-stat-${statKey}`} > {statKey} {`${toFixedFloorWithoutTrailingZeros(parsedValue.node[statKey]?.current ?? 0, 2)}${parsedValue.node[statKey]?.unit_hint ? ` ${parsedValue.node[statKey].unit_hint}` : ''}`} @@ -841,7 +849,12 @@ const AgentList: React.FC = ({ useHiddenColumnKeysSetting('AgentList'); return ( - +