From f48854e127e22e91da28bde394b32e3100475538 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 10:17:11 +0000 Subject: [PATCH 1/7] refactor(28703): add a subheader to the drawer --- .../src/components/ExpandableDrawer/ExpandableDrawer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hivemq-edge/src/frontend/src/components/ExpandableDrawer/ExpandableDrawer.tsx b/hivemq-edge/src/frontend/src/components/ExpandableDrawer/ExpandableDrawer.tsx index aab3bf6103..c31072e918 100644 --- a/hivemq-edge/src/frontend/src/components/ExpandableDrawer/ExpandableDrawer.tsx +++ b/hivemq-edge/src/frontend/src/components/ExpandableDrawer/ExpandableDrawer.tsx @@ -14,9 +14,10 @@ import DrawerExpandButton from '@/components/Chakra/DrawerExpandButton.tsx' interface ExpandableDrawerProps extends DrawerProps { header: string + subHeader?: JSX.Element } -const ExpandableDrawer: FC = ({ header, ...props }) => { +const ExpandableDrawer: FC = ({ header, subHeader, ...props }) => { // TODO[NVL] use local storage const [isExpanded, setExpanded] = useBoolean(true) @@ -28,6 +29,7 @@ const ExpandableDrawer: FC = ({ header, ...props }) => { {header} + {subHeader} {props.children} From ec92ccd9426edaf2fd21e828b66d0faf2b38f6ef Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 10:21:20 +0000 Subject: [PATCH 2/7] refactor(28703): refactor the name component for consistency --- .../components/parts/NodeNameCard.tsx | 80 ++++++++++--------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx index c829b4b92d..067a2bfef9 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx @@ -1,54 +1,60 @@ import { FC, useMemo } from 'react' -import { Node } from 'reactflow' -import { Card, CardBody, HStack, Icon, StackDivider, Tag, Text, VStack } from '@chakra-ui/react' -import { PiBridgeThin, PiPlugsConnectedFill } from 'react-icons/pi' -import { useTranslation } from 'react-i18next' +import { Card, CardBody, HStack, Icon, Image, StackDivider, Text, VStack } from '@chakra-ui/react' +import { PiBridgeThin } from 'react-icons/pi' +import { GrStatusUnknown } from 'react-icons/gr' +import { ImMakeGroup } from 'react-icons/im' -import { Adapter, Bridge } from '@/api/__generated__' -import { useGetAdapterTypes } from '@/api/hooks/useProtocolAdapters/useGetAdapterTypes.ts' +import edgeLogo from '@/assets/edge/05-icon-industrial-hivemq-edge.svg' -import { NodeTypes } from '../../types.ts' +import { deviceCategoryIcon, ProtocolAdapterCategoryName } from '@/modules/Workspace/utils/adapter.utils.ts' +import { NodeTypes } from '@/modules/Workspace/types.ts' interface NodeNameCardProps { - selectedNode: Node + type: NodeTypes + name?: string + description?: string + icon?: string } -const NodeNameCard: FC = ({ selectedNode }) => { - const { t } = useTranslation() - const { data } = useGetAdapterTypes() - const { type } = selectedNode - - const adapterType = useMemo(() => { - if (!data) return undefined - if (type === NodeTypes.BRIDGE_NODE) return undefined +const NodeNameCard: FC = ({ name, type, description, icon }) => { + const EntityIcon = useMemo(() => { + switch (type) { + case NodeTypes.ADAPTER_NODE: + // return + return - const adapterType = (selectedNode as Node).data.type - return data?.items?.find((e) => e.id === adapterType) - }, [data, selectedNode, type]) + case NodeTypes.BRIDGE_NODE: + return + case NodeTypes.CLUSTER_NODE: + return + case NodeTypes.EDGE_NODE: + return SS - const EntityIcon = useMemo(() => { - if (type === NodeTypes.BRIDGE_NODE) - return ( - - ) - return - }, [type]) + case NodeTypes.DEVICE_NODE: + return ( + + ) + default: + return + } + }, [icon, type]) return ( - + }> - - {EntityIcon} - - {t('workspace.device.type', { context: type })}{' '} - - - - - {adapterType && {adapterType.name}} + {EntityIcon} + - {selectedNode.data.id} + {name} + + + {description} From d2aad94964581c151dff8c6cfb9bceed4f271bbd Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 10:24:16 +0000 Subject: [PATCH 3/7] refactor(28703): add the name container to all side panels --- .../Mappings/AdapterMappingManager.tsx | 14 ++++++++++ .../drawers/AdapterInstanceDrawer.tsx | 11 ++------ .../TopicFilters/TopicFilterManager.tsx | 3 ++ .../drawers/DevicePropertyDrawer.tsx | 14 ++++++---- .../components/drawers/EdgePropertyDrawer.tsx | 3 ++ .../drawers/GroupPropertyDrawer.tsx | 15 ++++------ .../components/drawers/LinkPropertyDrawer.tsx | 28 +++++++++++-------- .../components/drawers/NodePropertyDrawer.tsx | 17 +++++++++-- 8 files changed, 68 insertions(+), 37 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/Mappings/AdapterMappingManager.tsx b/hivemq-edge/src/frontend/src/modules/Mappings/AdapterMappingManager.tsx index e9c04c2abb..cd7eb33e4c 100644 --- a/hivemq-edge/src/frontend/src/modules/Mappings/AdapterMappingManager.tsx +++ b/hivemq-edge/src/frontend/src/modules/Mappings/AdapterMappingManager.tsx @@ -30,6 +30,8 @@ import { NodeTypes } from '@/modules/Workspace/types.ts' import useWorkspaceStore from '@/modules/Workspace/hooks/useWorkspaceStore.ts' import { useSouthboundMappingManager } from '@/modules/Mappings/hooks/useSouthboundMappingManager.ts' import { MappingType } from './types' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' +import { useGetAdapterTypes } from '@/api/hooks/useProtocolAdapters/useGetAdapterTypes.ts' interface AdapterMappingManagerProps { type: MappingType @@ -48,6 +50,12 @@ const AdapterMappingManager: FC = ({ type }) => { return nodes.find((node) => node.id === nodeId && node.type === NodeTypes.ADAPTER_NODE) as Node | undefined }, [nodeId, nodes]) + const { data: protocols } = useGetAdapterTypes() + const adapterProtocol = + selectedNode?.type === NodeTypes.ADAPTER_NODE + ? protocols?.items?.find((e) => e.id === (selectedNode as Node).data.type) + : undefined + const handleClose = () => { onClose() navigate('/workspace') @@ -70,6 +78,12 @@ const AdapterMappingManager: FC = ({ type }) => { {t('protocolAdapter.mapping.manager.header', { context: type })} + {!adapterId && } diff --git a/hivemq-edge/src/frontend/src/modules/ProtocolAdapters/components/drawers/AdapterInstanceDrawer.tsx b/hivemq-edge/src/frontend/src/modules/ProtocolAdapters/components/drawers/AdapterInstanceDrawer.tsx index 0980eea624..1c7c7e75c9 100644 --- a/hivemq-edge/src/frontend/src/modules/ProtocolAdapters/components/drawers/AdapterInstanceDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/ProtocolAdapters/components/drawers/AdapterInstanceDrawer.tsx @@ -14,8 +14,6 @@ import { DrawerHeader, DrawerOverlay, Flex, - HStack, - Image, Text, } from '@chakra-ui/react' @@ -29,6 +27,8 @@ import { getRequiredUiSchema } from '@/modules/ProtocolAdapters/utils/uiSchema.u import { AdapterContext } from '@/modules/ProtocolAdapters/types.ts' import ChakraRJSForm from '@/components/rjsf/Form/ChakraRJSForm.tsx' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' +import { NodeTypes } from '@/modules/Workspace/types.ts' interface AdapterInstanceDrawerProps { adapterType?: string @@ -96,12 +96,7 @@ const AdapterInstanceDrawer: FC = ({ {isNewAdapter ? t('protocolAdapter.drawer.title.create') : t('protocolAdapter.drawer.title.update')} - - - - {name} - - + {schema && ( diff --git a/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.tsx b/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.tsx index 82f9224ace..713143ea9f 100644 --- a/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.tsx +++ b/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.tsx @@ -16,6 +16,8 @@ import PaginatedTable from '@/components/PaginatedTable/PaginatedTable.tsx' import ArrayItemDrawer from '@/components/rjsf/SplitArrayEditor/components/ArrayItemDrawer.tsx' import TopicSchemaDrawer from '@/modules/TopicFilters/components/TopicSchemaDrawer.tsx' import SchemaValidationMark from '@/modules/TopicFilters/components/SchemaValidationMark.tsx' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' +import { NodeTypes } from '@/modules/Workspace/types.ts' const TopicFilterManager: FC = () => { const { t } = useTranslation() @@ -115,6 +117,7 @@ const TopicFilterManager: FC = () => { return ( } isOpen={isOpen} onClose={handleClose} closeOnOverlayClick={false} diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.tsx index 3d18f64d78..5fd02c5787 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.tsx @@ -15,10 +15,10 @@ import { Adapter } from '@/api/__generated__' import { useGetAdapterTypes } from '@/api/hooks/useProtocolAdapters/useGetAdapterTypes.ts' import LoaderSpinner from '@/components/Chakra/LoaderSpinner.tsx' import ErrorMessage from '@/components/ErrorMessage.tsx' -import DeviceMetadataViewer from '@/modules/Device/components/DeviceMetadataViewer.tsx' import DeviceTagList from '@/modules/Device/components/DeviceTagList.tsx' import useWorkspaceStore from '@/modules/Workspace/hooks/useWorkspaceStore.ts' -import { DeviceMetadata } from '@/modules/Workspace/types.ts' +import { DeviceMetadata, NodeTypes } from '@/modules/Workspace/types.ts' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' interface DevicePropertyDrawerProps { nodeId: string @@ -48,12 +48,14 @@ const DevicePropertyDrawer: FC = ({ isOpen, selectedN {t('workspace.property.header', { context: selectedNode.type })} + - - - - + diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/EdgePropertyDrawer.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/EdgePropertyDrawer.tsx index e8fd9dfcfc..a95106c37a 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/EdgePropertyDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/EdgePropertyDrawer.tsx @@ -14,6 +14,8 @@ import { import TopicExplorer from '@/modules/Workspace/components/topics/TopicExplorer.tsx' import MetadataExplorer from '@/modules/Workspace/components/topics/MetadataExplorer.tsx' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' +import { NodeTypes } from '@/modules/Workspace/types.ts' interface NodePropertyDrawerProps { nodeId: string @@ -35,6 +37,7 @@ const EdgePropertyDrawer: FC = ({ isOpen, selectedNode, {t('workspace.property.header', { context: selectedNode.type })} + {' '} setSelectedTopic(topic)} /> diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.tsx index 21d57b1bb0..b6243ac34e 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.tsx @@ -2,7 +2,6 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { Node } from 'reactflow' import { - Box, Drawer, DrawerBody, DrawerCloseButton, @@ -19,6 +18,7 @@ import useWorkspaceStore from '../../hooks/useWorkspaceStore.ts' import { getDefaultMetricsFor } from '../../utils/nodes-utils.ts' import GroupMetadataEditor from '../parts/GroupMetadataEditor.tsx' import { ChartType } from '@/modules/Metrics/types.ts' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' interface GroupPropertyDrawerProps { nodeId: string @@ -56,14 +56,11 @@ const GroupPropertyDrawer: FC = ({ {panelTitle} - - {selectedNode.data.childrenNodeIds.map((e) => ( - - {t('workspace.device.type', { context: NodeTypes.ADAPTER_NODE })}:{' '} - {nodes.find((x) => x.id === e)?.data.id} - - ))} - + {showConfig && ( diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/LinkPropertyDrawer.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/LinkPropertyDrawer.tsx index 51bca44b7f..dd50d0b2fd 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/LinkPropertyDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/LinkPropertyDrawer.tsx @@ -1,13 +1,14 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { Node } from 'reactflow' -import { Box, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerHeader, Text } from '@chakra-ui/react' +import { Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerHeader, Text } from '@chakra-ui/react' import { Adapter, Bridge } from '@/api/__generated__' +import { useGetAdapterTypes } from '@/api/hooks/useProtocolAdapters/useGetAdapterTypes.ts' import MetricsContainer from '@/modules/Metrics/MetricsContainer.tsx' - -import { getDefaultMetricsFor } from '../../utils/nodes-utils.ts' -import { NodeTypes } from '../../types.ts' +import NodeNameCard from '@/modules/Workspace/components/parts/NodeNameCard.tsx' +import { NodeTypes } from '@/modules/Workspace/types.ts' +import { getDefaultMetricsFor } from '@/modules/Workspace/utils/nodes-utils.ts' interface LinkPropertyDrawerProps { nodeId: string @@ -19,20 +20,25 @@ interface LinkPropertyDrawerProps { const LinkPropertyDrawer: FC = ({ nodeId, isOpen, selectedNode, onClose }) => { const { t } = useTranslation() + const { data: protocols } = useGetAdapterTypes() + const adapterProtocol = + selectedNode.type === NodeTypes.ADAPTER_NODE + ? protocols?.items?.find((e) => e.id === (selectedNode as Node).data.type) + : undefined return ( - {/**/} - - {t('workspace.observability.header', { context: selectedNode.type })} - - {t('workspace.device.type', { context: selectedNode.type })}: {selectedNode.data.id} - - + {t('workspace.observability.header', { context: selectedNode.type })} + = ({ nodeId, isOpen, selectedNode, onClose, onEditEntity }) => { const { t } = useTranslation() + const { data: protocols } = useGetAdapterTypes() + const adapterProtocol = + selectedNode.type === NodeTypes.ADAPTER_NODE + ? protocols?.items?.find((e) => e.id === (selectedNode as Node).data.type) + : undefined return ( @@ -49,10 +55,15 @@ const NodePropertyDrawer: FC = ({ nodeId, isOpen, selec - {t('workspace.property.header', { context: selectedNode.type })} + {t('workspace.property.header', { context: selectedNode.type })} + - Date: Mon, 16 Dec 2024 10:24:29 +0000 Subject: [PATCH 4/7] refactor(28703): fix translations --- hivemq-edge/src/frontend/src/locales/en/translation.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hivemq-edge/src/frontend/src/locales/en/translation.json b/hivemq-edge/src/frontend/src/locales/en/translation.json index a90fbaf2e4..415882a200 100755 --- a/hivemq-edge/src/frontend/src/locales/en/translation.json +++ b/hivemq-edge/src/frontend/src/locales/en/translation.json @@ -765,7 +765,9 @@ "device": { "type_ADAPTER_NODE": "adapter", "type_BRIDGE_NODE": "bridge", - "type_EDGE_NODE": "edge" + "type_EDGE_NODE": "edge", + "type_DEVICE_NODE": "device", + "type_CLUSTER_NODE": "Group" }, "layout": { "HORIZONTAL": "Horizontal", From eb496a70c575553253a335be293fcd01fa03aeff Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 10:56:15 +0000 Subject: [PATCH 5/7] fix(28703): fix layout of the card --- .../components/parts/NodeNameCard.tsx | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx index 067a2bfef9..509c4200c5 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.tsx @@ -20,15 +20,25 @@ const NodeNameCard: FC = ({ name, type, description, icon }) const EntityIcon = useMemo(() => { switch (type) { case NodeTypes.ADAPTER_NODE: - // return - return + return ( + + ) case NodeTypes.BRIDGE_NODE: return case NodeTypes.CLUSTER_NODE: return case NodeTypes.EDGE_NODE: - return SS + return ( + SS + ) case NodeTypes.DEVICE_NODE: return ( @@ -50,12 +60,16 @@ const NodeNameCard: FC = ({ name, type, description, icon }) }> {EntityIcon} - - {name} - - - {description} - + {name && ( + + {name} + + )} + {description && ( + + {description} + + )} From 6bb8a69892a4aa96cdff88cdbfea21c104b79423 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 10:56:24 +0000 Subject: [PATCH 6/7] test(28703): fix tests --- .../components/parts/NodeNameCard.spec.cy.tsx | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.spec.cy.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.spec.cy.tsx index c11778e3d8..5b7985e657 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.spec.cy.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/NodeNameCard.spec.cy.tsx @@ -1,49 +1,54 @@ -/// - -import { Node } from 'reactflow' - -import { MOCK_NODE_ADAPTER, MOCK_NODE_BRIDGE } from '@/__test-utils__/react-flow/nodes.ts' -import { Adapter, Bridge } from '@/api/__generated__' import { NodeTypes } from '@/modules/Workspace/types.ts' +import anyLogo from '@/assets/edge/05-icon-industrial-hivemq-edge.svg' import NodeNameCard from './NodeNameCard.tsx' import { mockProtocolAdapter } from '@/api/hooks/useProtocolAdapters/__handlers__' -const mockNodeAdapter: Node = { - position: { x: 0, y: 0 }, - id: 'adapter@fgffgf', - type: NodeTypes.ADAPTER_NODE, - data: MOCK_NODE_ADAPTER.data, -} - -const mockNodeBridg: Node = { - position: { x: 0, y: 0 }, - id: 'adapter@fgffgf', - type: NodeTypes.BRIDGE_NODE, - data: MOCK_NODE_BRIDGE.data, -} - describe('NodeNameCard', () => { beforeEach(() => { cy.viewport(400, 400) - cy.intercept('/api/v1/management/protocol-adapters/types', { items: [mockProtocolAdapter] }).as('getConfig1') + cy.intercept('/api/v1/management/protocol-adapters/types', { items: [mockProtocolAdapter] }).as('getConfig') }) it('should render adapter properly', () => { - cy.mountWithProviders() + cy.mountWithProviders( + + ) cy.getByTestId('node-type-icon').should('exist').should('have.attr', 'data-nodeicon', NodeTypes.ADAPTER_NODE) - cy.getByTestId('node-type-text').should('contain.text', 'adapter') - cy.getByTestId('node-adapter-type').should('contain.text', 'Simulated Edge Device') - cy.getByTestId('node-name').should('contain.text', 'my-adapter') + cy.getByTestId('node-name').should('contain.text', 'The adapter') + cy.getByTestId('node-description').should('contain.text', 'The adapter type') }) it('should render bridge properly', () => { - cy.mountWithProviders() + cy.mountWithProviders() cy.getByTestId('node-type-icon').should('exist').should('have.attr', 'data-nodeicon', NodeTypes.BRIDGE_NODE) - cy.getByTestId('node-type-text').should('contain.text', 'bridge') - cy.getByTestId('node-adapter-type').should('not.exist') - cy.getByTestId('node-name').should('contain.text', 'bridge-id-01') + cy.getByTestId('node-name').should('contain.text', 'The Bridge') + cy.getByTestId('node-description').should('contain.text', 'Bridge') + }) + + it('should render groups properly', () => { + cy.mountWithProviders() + + cy.getByTestId('node-type-icon').should('exist').should('have.attr', 'data-nodeicon', NodeTypes.CLUSTER_NODE) + cy.getByTestId('node-name').should('contain.text', 'The Group') + cy.getByTestId('node-description').should('contain.text', 'Group') + }) + + it('should render the edge properly', () => { + cy.mountWithProviders() + + cy.getByTestId('node-type-icon').should('exist').should('have.attr', 'data-nodeicon', NodeTypes.EDGE_NODE) + cy.getByTestId('node-name').should('contain.text', 'The Edge') + cy.getByTestId('node-description').should('not.exist') + }) + + it('should render the devices properly', () => { + cy.mountWithProviders() + + cy.getByTestId('node-type-icon').should('exist').should('have.attr', 'data-nodeicon', NodeTypes.DEVICE_NODE) + cy.getByTestId('node-name').should('not.exist') + cy.getByTestId('node-description').should('not.exist') }) }) From b905161e3f1652e2397bcab8458f2e6a124fed19 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Mon, 16 Dec 2024 11:33:27 +0000 Subject: [PATCH 7/7] test(28703): fix tests --- .../src/modules/TopicFilters/TopicFilterManager.spec.cy.tsx | 2 +- .../components/drawers/DevicePropertyDrawer.spec.cy.tsx | 3 +-- .../components/drawers/GroupPropertyDrawer.spec.cy.tsx | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.spec.cy.tsx b/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.spec.cy.tsx index a0a10e07e2..a216e3fbc4 100644 --- a/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.spec.cy.tsx +++ b/hivemq-edge/src/frontend/src/modules/TopicFilters/TopicFilterManager.spec.cy.tsx @@ -22,7 +22,7 @@ describe('TopicFilterManager', () => { cy.mountWithProviders() - cy.get('header').should('have.text', 'Manage topic filters') + cy.get('header > p').should('have.text', 'Manage topic filters') cy.get('table').should('be.visible') cy.get('table').as('table').should('have.attr', 'aria-label', 'List of topic filters') diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.spec.cy.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.spec.cy.tsx index 1ed12a2b67..2938a5caf0 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.spec.cy.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/DevicePropertyDrawer.spec.cy.tsx @@ -75,7 +75,6 @@ describe('DevicePropertyDrawer', () => { cy.get('@onClose').should('have.been.calledOnce') cy.get('header').should('contain.text', 'Device Overview') - cy.get('h2').eq(0).should('contain.text', 'simulation') - cy.get('h2').eq(1).should('contain.text', 'List of Device Tags') + cy.get('h2').eq(0).should('contain.text', 'List of Device Tags') }) }) diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.spec.cy.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.spec.cy.tsx index f13ebd9f01..f30c949ca5 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.spec.cy.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/drawers/GroupPropertyDrawer.spec.cy.tsx @@ -43,8 +43,6 @@ describe('GroupPropertyDrawer', () => { cy.wait('@getMetricForX') cy.getByTestId('group-panel-title').should('contain.text', 'Group Observability') - cy.getByTestId('group-panel-keys').find('p').eq(0).should('contain.text', 'adapter: bridge-id-01') - cy.getByTestId('group-panel-keys').find('p').eq(1).should('contain.text', 'adapter: my-adapter') cy.get('dt').eq(0).should('contain.text', 'bridge-id-01') cy.get('dt').eq(1).should('contain.text', 'my-adapter')