code.gitea.io/gitea@v1.21.7/web_src/js/features/common-issue-list.test.js (about) 1 import {parseIssueListQuickGotoLink} from './common-issue-list.js'; 2 3 test('parseIssueListQuickGotoLink', () => { 4 expect(parseIssueListQuickGotoLink('/link', '')).toEqual(''); 5 expect(parseIssueListQuickGotoLink('/link', 'abc')).toEqual(''); 6 expect(parseIssueListQuickGotoLink('/link', '123')).toEqual('/link/issues/123'); 7 expect(parseIssueListQuickGotoLink('/link', '#123')).toEqual('/link/issues/123'); 8 expect(parseIssueListQuickGotoLink('/link', 'owner/repo#123')).toEqual(''); 9 10 expect(parseIssueListQuickGotoLink('', '')).toEqual(''); 11 expect(parseIssueListQuickGotoLink('', 'abc')).toEqual(''); 12 expect(parseIssueListQuickGotoLink('', '123')).toEqual(''); 13 expect(parseIssueListQuickGotoLink('', '#123')).toEqual(''); 14 expect(parseIssueListQuickGotoLink('', 'owner/repo#')).toEqual(''); 15 expect(parseIssueListQuickGotoLink('', 'owner/repo#123')).toEqual('/owner/repo/issues/123'); 16 });