Skip to content

Commit

Permalink
test(28015): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Nov 28, 2024
1 parent e929644 commit 428a922
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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 <h2>{children}</h2>
Expand All @@ -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(<DataModelSources topic="test" />)
cy.get('h3').should('have.text', 'Sources')
// loading
Expand Down

0 comments on commit 428a922

Please sign in to comment.