@@ -207,6 +207,57 @@ describe('EnumTransformer - Null Safety', () => {
207207 example : 'example1' , // First example should be used
208208 } ) ;
209209 } ) ;
210+
211+ it ( 'should merge title property correctly' , ( ) => {
212+ const first : Tsoa . RefEnumType = {
213+ dataType : 'refEnum' ,
214+ refName : 'TestEnum' ,
215+ enums : [ 'value1' ] ,
216+ enumVarnames : [ 'VALUE1' ] ,
217+ description : 'First enum' ,
218+ deprecated : false ,
219+ title : 'First Title' ,
220+ } ;
221+
222+ const second : Tsoa . RefEnumType = {
223+ dataType : 'refEnum' ,
224+ refName : 'TestEnum' ,
225+ enums : [ 'value2' ] ,
226+ enumVarnames : [ 'VALUE2' ] ,
227+ description : 'Second enum' ,
228+ deprecated : false ,
229+ title : 'Second Title' ,
230+ } ;
231+
232+ const result = EnumTransformer . merge ( first , second ) ;
233+
234+ expect ( result . title ) . to . equal ( 'First Title' ) ; // First title should be used
235+ } ) ;
236+
237+ it ( 'should use second title if first is undefined' , ( ) => {
238+ const first : Tsoa . RefEnumType = {
239+ dataType : 'refEnum' ,
240+ refName : 'TestEnum' ,
241+ enums : [ 'value1' ] ,
242+ enumVarnames : [ 'VALUE1' ] ,
243+ description : 'First enum' ,
244+ deprecated : false ,
245+ } ;
246+
247+ const second : Tsoa . RefEnumType = {
248+ dataType : 'refEnum' ,
249+ refName : 'TestEnum' ,
250+ enums : [ 'value2' ] ,
251+ enumVarnames : [ 'VALUE2' ] ,
252+ description : 'Second enum' ,
253+ deprecated : false ,
254+ title : 'Second Title' ,
255+ } ;
256+
257+ const result = EnumTransformer . merge ( first , second ) ;
258+
259+ expect ( result . title ) . to . equal ( 'Second Title' ) ;
260+ } ) ;
210261 } ) ;
211262
212263 describe ( 'mergeMany method' , ( ) => {
0 commit comments