@@ -162,6 +162,37 @@ describe('transformMetaExtended helpers', () => {
162162 expect ( handledCube ) . toHaveProperty ( 'dimensions' ) ;
163163 } ) ;
164164
165+ test ( 'transformCube - extends field preservation' , ( ) => {
166+ const mockCubeDefinitions = {
167+ BaseCube : { extends : ( ) => 'BaseCube' } ,
168+ ExtendedCube : { extends : ( ) => 'ExtendedCube' } ,
169+ AnotherCube : { extends : ( ) => 'AnotherCube' } ,
170+ TestCube : { extends : ( ) => 'TestCube' } ,
171+ SampleCube : { extends : ( ) => 'SampleCube' }
172+ } ;
173+
174+ const mockCubes = [
175+ { name : 'BaseCube' } ,
176+ { name : 'ExtendedCube' } ,
177+ { name : 'AnotherCube' } ,
178+ { name : 'TestCube' } ,
179+ { name : 'SampleCube' }
180+ ] ;
181+
182+ mockCubes . forEach ( cube => {
183+ const transformedCube = transformCube ( cube , mockCubeDefinitions ) ;
184+ expect ( transformedCube ) . toBeDefined ( ) ;
185+ expect ( transformedCube . extends ) . toBe ( `'${ cube . name } '` ) ;
186+ } ) ;
187+
188+ // Specific test cases to verify first letter preservation
189+ const baseCube = transformCube ( { name : 'BaseCube' } , mockCubeDefinitions ) ;
190+ expect ( baseCube . extends ) . toBe ( '\'BaseCube\'' ) ;
191+
192+ const extendedCube = transformCube ( { name : 'ExtendedCube' } , mockCubeDefinitions ) ;
193+ expect ( extendedCube . extends ) . toBe ( '\'ExtendedCube\'' ) ;
194+ } ) ;
195+
165196 test ( 'transformDimension' , ( ) => {
166197 const handledDimension = transformDimension ( MOCK_USERS_CUBE . dimensions . id , MOCK_USERS_CUBE ) ;
167198 expect ( handledDimension ) . toBeDefined ( ) ;
0 commit comments