1212 */
1313import { fireEvent , render , screen , waitFor } from '@testing-library/react' ;
1414import DescriptionSection from './DescriptionSection' ;
15+ import { EntityType } from '../../../enums/entity.enum' ;
1516
1617// Mock i18n
1718jest . mock ( 'react-i18next' , ( ) => ( {
@@ -84,7 +85,7 @@ describe('DescriptionSection', () => {
8485
8586 describe ( 'Rendering - Empty Description' , ( ) => {
8687 it ( 'renders title and no-data placeholder when description is empty' , ( ) => {
87- const { container } = render ( < DescriptionSection /> ) ;
88+ const { container } = render ( < DescriptionSection entityType = { EntityType . LINEAGE_EDGE } /> ) ;
8889
8990 expect ( screen . getByText ( 'label.description' ) ) . toBeInTheDocument ( ) ;
9091 expect (
@@ -108,6 +109,7 @@ describe('DescriptionSection', () => {
108109 < DescriptionSection
109110 hasPermission
110111 showEditButton
112+ entityType = { EntityType . LINEAGE_EDGE }
111113 onDescriptionUpdate = { jest . fn ( ) }
112114 />
113115 ) ;
@@ -120,6 +122,7 @@ describe('DescriptionSection', () => {
120122 it ( 'does not show edit control when showEditButton is false' , ( ) => {
121123 render (
122124 < DescriptionSection
125+ entityType = { EntityType . LINEAGE_EDGE }
123126 showEditButton = { false }
124127 onDescriptionUpdate = { jest . fn ( ) }
125128 />
@@ -133,7 +136,7 @@ describe('DescriptionSection', () => {
133136 } ) ;
134137
135138 it ( 'does not show edit control when onDescriptionUpdate is not provided' , ( ) => {
136- render ( < DescriptionSection showEditButton /> ) ;
139+ render ( < DescriptionSection showEditButton entityType = { EntityType . LINEAGE_EDGE } /> ) ;
137140
138141 const clickable = document . querySelector (
139142 '.description-header .edit-icon'
@@ -149,6 +152,7 @@ describe('DescriptionSection', () => {
149152 < DescriptionSection
150153 hasPermission
151154 showEditButton
155+ entityType = { EntityType . LINEAGE_EDGE }
152156 onDescriptionUpdate = { jest . fn ( ) }
153157 />
154158 ) ;
@@ -176,6 +180,7 @@ describe('DescriptionSection', () => {
176180 < DescriptionSection
177181 hasPermission
178182 showEditButton
183+ entityType = { EntityType . LINEAGE_EDGE }
179184 onDescriptionUpdate = { onUpdate }
180185 />
181186 ) ;
@@ -199,6 +204,7 @@ describe('DescriptionSection', () => {
199204 render (
200205 < DescriptionSection
201206 description = "Some markdown text"
207+ entityType = { EntityType . LINEAGE_EDGE }
202208 onDescriptionUpdate = { jest . fn ( ) }
203209 />
204210 ) ;
@@ -218,6 +224,7 @@ describe('DescriptionSection', () => {
218224 hasPermission
219225 showEditButton
220226 description = "Content"
227+ entityType = { EntityType . LINEAGE_EDGE }
221228 onDescriptionUpdate = { jest . fn ( ) }
222229 />
223230 ) ;
0 commit comments