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 82d199674..b5e29fc2a 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 @@ -7,6 +7,7 @@ import { MOCK_METRICS } from '@/api/hooks/useGetMetrics/__handlers__' import { MetricList } from '@/api/__generated__' import { MOCK_NODE_ADAPTER } from '@/__test-utils__/react-flow/nodes.ts' import { MOCK_ADAPTER_ID, MOCK_ADAPTER_ID2 } from '@/__test-utils__/mocks.ts' +import { mockEdgeEvent } from '@/api/hooks/useEvents/__handlers__' const mockNode: Node = { position: { x: 0, y: 0 }, @@ -37,7 +38,7 @@ describe('GroupPropertyDrawer', () => { cy.intercept('/api/v1/metrics/**', []).as('getMetricForX') }) - it('should render properly', () => { + it('should render the minimal metrics properly', () => { const onClose = cy.stub().as('onClose') const onEditEntity = cy.stub() cy.mountWithProviders( @@ -67,6 +68,47 @@ describe('GroupPropertyDrawer', () => { cy.getByTestId('metrics-toggle').should('be.visible') }) + it.only('should render the full config tabs properly', () => { + cy.intercept('/api/v1/management/events?*', { items: [...mockEdgeEvent(150)] }) + const onClose = cy.stub().as('onClose') + const onEditEntity = cy.stub() + cy.mountWithProviders( + + ) + + cy.wait('@getMetricForX') + + // check the panel header + cy.getByTestId('group-panel-title').should('contain.text', 'Group Overview') + + // check the panel control + cy.get('@onClose').should('not.have.been.called') + cy.getByAriaLabel('Close').click() + cy.get('@onClose').should('have.been.calledOnce') + + // check the panel tabs + cy.get('[role="tablist"] [role="tab"]').should('have.length', 3) + cy.get('[role="tablist"] [role="tab"]').eq(0).should('have.text', 'Configuration') + cy.get('[role="tablist"] [role="tab"]').eq(1).should('have.text', 'Events') + cy.get('[role="tablist"] [role="tab"]').eq(2).should('have.text', 'Metrics') + + cy.get('[role="tablist"] + div > [role="tabpanel"]').should('have.length', 3) + cy.get('[role="tablist"] + div > [role="tabpanel"]').eq(0).should('not.have.attr', 'hidden') + cy.get('[role="tablist"] + div > [role="tabpanel"]').eq(1).should('have.attr', 'hidden') + cy.get('[role="tablist"] + div > [role="tabpanel"]').eq(2).should('have.attr', 'hidden') + + cy.getByTestId('group-metadata-header').should('be.visible') + cy.getByTestId('group-content-header').should('be.visible') + }) + it('should be accessible', () => { cy.injectAxe() cy.mountWithProviders( diff --git a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/GroupMetadataEditor.tsx b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/GroupMetadataEditor.tsx index bb6cb84ef..a6b0c1630 100644 --- a/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/GroupMetadataEditor.tsx +++ b/hivemq-edge/src/frontend/src/modules/Workspace/components/parts/GroupMetadataEditor.tsx @@ -27,7 +27,7 @@ const GroupMetadataEditor: FC = ({ group, onSubmit }) return ( - {t('workspace.grouping.editor.title')} + {t('workspace.grouping.editor.title')}