Make issue suggestion work for all editors (#33340)
And do not handle special keys when the text-expander popup exists
This commit is contained in:
parent
46d1e91aed
commit
2cb3946496
5 changed files with 34 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
basename, extname, isObject, stripTags, parseIssueHref,
|
||||
parseUrl, translateMonth, translateDay, blobToDataURI,
|
||||
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64, isImageFile, isVideoFile, parseIssueNewHref,
|
||||
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64, isImageFile, isVideoFile, parseRepoOwnerPathInfo,
|
||||
} from './utils.ts';
|
||||
|
||||
test('basename', () => {
|
||||
|
@ -45,12 +45,14 @@ test('parseIssueHref', () => {
|
|||
expect(parseIssueHref('')).toEqual({ownerName: undefined, repoName: undefined, type: undefined, index: undefined});
|
||||
});
|
||||
|
||||
test('parseIssueNewHref', () => {
|
||||
expect(parseIssueNewHref('/owner/repo/issues/new')).toEqual({ownerName: 'owner', repoName: 'repo', pathType: 'issues'});
|
||||
expect(parseIssueNewHref('/owner/repo/issues/new?query')).toEqual({ownerName: 'owner', repoName: 'repo', pathType: 'issues'});
|
||||
expect(parseIssueNewHref('/sub/owner/repo/issues/new#hash')).toEqual({ownerName: 'owner', repoName: 'repo', pathType: 'issues'});
|
||||
expect(parseIssueNewHref('/sub/owner/repo/compare/feature/branch-1...fix/branch-2')).toEqual({ownerName: 'owner', repoName: 'repo', pathType: 'pulls'});
|
||||
expect(parseIssueNewHref('/other')).toEqual({});
|
||||
test('parseRepoOwnerPathInfo', () => {
|
||||
expect(parseRepoOwnerPathInfo('/owner/repo/issues/new')).toEqual({ownerName: 'owner', repoName: 'repo'});
|
||||
expect(parseRepoOwnerPathInfo('/owner/repo/releases')).toEqual({ownerName: 'owner', repoName: 'repo'});
|
||||
expect(parseRepoOwnerPathInfo('/other')).toEqual({});
|
||||
window.config.appSubUrl = '/sub';
|
||||
expect(parseRepoOwnerPathInfo('/sub/owner/repo/issues/new')).toEqual({ownerName: 'owner', repoName: 'repo'});
|
||||
expect(parseRepoOwnerPathInfo('/sub/owner/repo/compare/feature/branch-1...fix/branch-2')).toEqual({ownerName: 'owner', repoName: 'repo'});
|
||||
window.config.appSubUrl = '';
|
||||
});
|
||||
|
||||
test('parseUrl', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue