@@ -214,6 +214,24 @@ describe("calculateFileUrl", () => {
214214 expect ( url ) . toBe ( "/en/tidb/dev/page/" ) ;
215215 } ) ;
216216
217+ it ( "should resolve tidb-data-migration _index with release branch alias" , ( ) => {
218+ const absolutePath = path . join (
219+ sourceBasePath ,
220+ "zh/tidb-data-migration/release-2.0/_index.md"
221+ ) ;
222+ const url = calculateFileUrlWithConfig ( absolutePath , testConfig ) ;
223+ expect ( url ) . toBe ( "/zh/tidb-data-migration/v2.0" ) ;
224+ } ) ;
225+
226+ it ( "should resolve tidb-data-migration pages with release branch alias" , ( ) => {
227+ const absolutePath = path . join (
228+ sourceBasePath ,
229+ "zh/tidb-data-migration/release-2.0/overview.md"
230+ ) ;
231+ const url = calculateFileUrlWithConfig ( absolutePath , testConfig ) ;
232+ expect ( url ) . toBe ( "/zh/tidb-data-migration/v2.0/overview/" ) ;
233+ } ) ;
234+
217235 it ( "should resolve api folder" , ( ) => {
218236 const absolutePath = path . join (
219237 sourceBasePath ,
@@ -469,6 +487,19 @@ describe("calculateFileUrl with defaultLanguage: 'en'", () => {
469487 // release-8.5 -> stable via branch-alias-tidb (exact match takes precedence)
470488 expect ( url ) . toBe ( "/tidb/stable/alert-rules" ) ;
471489 } ) ;
490+
491+ it ( "should omit /en/ prefix for English tidb-data-migration files" , ( ) => {
492+ const absolutePath = path . join (
493+ sourceBasePath ,
494+ "en/tidb-data-migration/release-5.3/dm-overview.md"
495+ ) ;
496+ const url = calculateFileUrlWithConfig (
497+ absolutePath ,
498+ configWithDefaultLang ,
499+ true
500+ ) ;
501+ expect ( url ) . toBe ( "/tidb-data-migration/v5.3/dm-overview" ) ;
502+ } ) ;
472503} ) ;
473504
474505describe ( "calculateFileUrl with slug format (relative path)" , ( ) => {
0 commit comments