1
1
mirror of https://github.com/go-gitea/gitea synced 2025-02-26 06:44:19 +00:00
gitea/web_src/js/features/repo-common.test.ts
Giteabot ae595aa913
Improve Open-with URL encoding (#33666) (#33680)
Backport #33666 by wxiaoguang

Fix #33665

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-22 01:57:17 +08:00

8 lines
420 B
TypeScript

import {substituteRepoOpenWithUrl} from './repo-common.ts';
test('substituteRepoOpenWithUrl', () => {
// For example: "x-github-client://openRepo/https://github.com/go-gitea/gitea"
expect(substituteRepoOpenWithUrl('proto://a/{url}', 'https://gitea')).toEqual('proto://a/https://gitea');
expect(substituteRepoOpenWithUrl('proto://a?link={url}', 'https://gitea')).toEqual('proto://a?link=https%3A%2F%2Fgitea');
});