@@ -162,6 +162,42 @@ describe('transformMetaExtended helpers', () => {
162162 expect ( handledCube ) . toHaveProperty ( 'dimensions' ) ;
163163 } ) ;
164164
165+ test ( 'transformCube - extends field preservation' , ( ) => {
166+ // Test cases from the reported bug: extends field missing first letter
167+ const mockCubeDefinitions = {
168+ AncillaryReview : { extends : ( ) => 'AncillaryReview' } ,
169+ Agreement : { extends : ( ) => 'Agreement' } ,
170+ ApiProjectRisk : { extends : ( ) => 'ApiProjectRisk' } ,
171+ Disclosure : { extends : ( ) => 'Disclosure' } ,
172+ Certification : { extends : ( ) => 'Certification' }
173+ } ;
174+
175+ const mockCubes = [
176+ { name : 'AncillaryReview' } ,
177+ { name : 'Agreement' } ,
178+ { name : 'ApiProjectRisk' } ,
179+ { name : 'Disclosure' } ,
180+ { name : 'Certification' }
181+ ] ;
182+
183+ mockCubes . forEach ( cube => {
184+ const transformedCube = transformCube ( cube , mockCubeDefinitions ) ;
185+ expect ( transformedCube ) . toBeDefined ( ) ;
186+ expect ( transformedCube . extends ) . toBe ( `"${ cube . name } "` ) ;
187+ // Verify the first letter is not truncated
188+ expect ( transformedCube . extends ) . not . toBe ( `"${ cube . name . substring ( 1 ) } "` ) ;
189+ } ) ;
190+
191+ // Specific test for the reported examples
192+ const ancillaryReviewCube = transformCube ( { name : 'AncillaryReview' } , mockCubeDefinitions ) ;
193+ expect ( ancillaryReviewCube . extends ) . toBe ( '"AncillaryReview"' ) ;
194+ expect ( ancillaryReviewCube . extends ) . not . toBe ( '"ncillaryReview"' ) ; // Should not be truncated
195+
196+ const agreementCube = transformCube ( { name : 'Agreement' } , mockCubeDefinitions ) ;
197+ expect ( agreementCube . extends ) . toBe ( '"Agreement"' ) ;
198+ expect ( agreementCube . extends ) . not . toBe ( '"greement"' ) ; // Should not be truncated
199+ } ) ;
200+
165201 test ( 'transformDimension' , ( ) => {
166202 const handledDimension = transformDimension ( MOCK_USERS_CUBE . dimensions . id , MOCK_USERS_CUBE ) ;
167203 expect ( handledDimension ) . toBeDefined ( ) ;
0 commit comments