From 428a92287c62f4871990175da0185f4a013a8db6 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Thu, 28 Nov 2024 11:05:45 +0000 Subject: [PATCH] test(28015): fix tests --- .../components/DataModelSources.spec.cy.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hivemq-edge/src/frontend/src/components/rjsf/MqttTransformation/components/DataModelSources.spec.cy.tsx b/hivemq-edge/src/frontend/src/components/rjsf/MqttTransformation/components/DataModelSources.spec.cy.tsx index 692e5b4020..46014e6821 100644 --- a/hivemq-edge/src/frontend/src/components/rjsf/MqttTransformation/components/DataModelSources.spec.cy.tsx +++ b/hivemq-edge/src/frontend/src/components/rjsf/MqttTransformation/components/DataModelSources.spec.cy.tsx @@ -1,5 +1,6 @@ import DataModelSources from './DataModelSources.tsx' import { GENERATE_DATA_MODELS } from '@/api/hooks/useDomainModel/__handlers__' +import { MOCK_TOPIC_FILTER } from '@/api/hooks/useTopicFilters/__handlers__' const wrapper: React.JSXElementConstructor<{ children: React.ReactNode }> = ({ children }) => { return

{children}

@@ -8,12 +9,16 @@ const wrapper: React.JSXElementConstructor<{ children: React.ReactNode }> = ({ c describe('DataModelSources', () => { beforeEach(() => { cy.viewport(800, 900) - }) - it('should render properly', () => { - cy.intercept('/api/v1/management/domain/topics/schema?*', { test: GENERATE_DATA_MODELS(false, 'test') }).as( + cy.intercept('/api/v1/management/sampling/schema/**', GENERATE_DATA_MODELS(true, MOCK_TOPIC_FILTER.topicFilter)).as( 'getSchema' ) + cy.intercept('/api/v1/management/sampling/topic/**', (req) => { + req.reply({ items: [] }) + }) + }) + + it('should render properly', () => { cy.mountWithProviders() cy.get('h3').should('have.text', 'Sources') // loading