@@ -557,10 +557,23 @@ describe('buildIssueBody', () => {
557557 expect ( body ) . toContain ( 'https://crowdin.com/project/my-project' ) ;
558558 } ) ;
559559
560- it ( 'links directly to the string in the editor when slug and string.id are present' , ( ) => {
560+ it ( 'links directly to the string in the editor when slug, file.id and string.id are present' , ( ) => {
561+ const issue = { ...baseIssue , languageId : 'fr' , string : { text : 'Source' , id : 999 , file : { id : 5842 } } } ;
562+ const body = buildIssueBody ( issue , projectId , 'my-project' ) ;
563+ expect ( body ) . toContain ( 'https://crowdin.com/editor/my-project/5842/en-fr?view=comfortable#999' ) ;
564+ } ) ;
565+
566+ it ( 'links directly to the editor with a compound language code normalized (zh-CN → en-zhcn)' , ( ) => {
567+ const issue = { ...baseIssue , languageId : 'zh-CN' , string : { text : 'Source' , id : 91860 , file : { id : 5842 } } } ;
568+ const body = buildIssueBody ( issue , projectId , 'my-project' ) ;
569+ expect ( body ) . toContain ( 'https://crowdin.com/editor/my-project/5842/en-zhcn?view=comfortable#91860' ) ;
570+ } ) ;
571+
572+ it ( 'falls back to project page when file.id is absent' , ( ) => {
561573 const issue = { ...baseIssue , languageId : 'fr' , string : { text : 'Source' , id : 999 } } ;
562574 const body = buildIssueBody ( issue , projectId , 'my-project' ) ;
563- expect ( body ) . toContain ( 'https://crowdin.com/editor/my-project/fr#999' ) ;
575+ expect ( body ) . toContain ( 'https://crowdin.com/project/my-project' ) ;
576+ expect ( body ) . not . toContain ( '/editor/' ) ;
564577 } ) ;
565578
566579 it ( 'includes the File row when string.file.path is present' , ( ) => {
0 commit comments