mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Allow seeding a missing repo from a reference
Following a link to a repo we don't have only led to the explorer, but the reason it's missing is usually that we haven't seeded it yet. A deep link that can't be opened now says so instead of doing nothing.
This commit is contained in:
@@ -23,7 +23,14 @@ function target(link: string, local = true) {
|
||||
}
|
||||
|
||||
describe("parseDeepLink", () => {
|
||||
test.each([rid, `rad:///${repo}`, ` ${rid}\n`])("accepts %j", link => {
|
||||
test.each([
|
||||
rid,
|
||||
`rad:///${repo}`,
|
||||
` ${rid}\n`,
|
||||
`rad:///${rid}`,
|
||||
`rad://${rid}`,
|
||||
`rad:${rid}`,
|
||||
])("accepts %j", link => {
|
||||
expect(parseDeepLink(link)).toEqual({ type: "uri", uri: { repo } });
|
||||
});
|
||||
|
||||
@@ -59,13 +66,22 @@ describe("deepLinkTarget", () => {
|
||||
expect(target(link)).toEqual({ type: "route", route });
|
||||
});
|
||||
|
||||
test("opens the explorer when the repo is not here", () => {
|
||||
test("offers to seed a repo that is not here", () => {
|
||||
expect(target(`${rid}/cob/xyz.radicle.issue/${oid}`, false)).toEqual({
|
||||
type: "external",
|
||||
type: "missing",
|
||||
rid,
|
||||
url: `${explorer}/issues/${oid}`,
|
||||
});
|
||||
});
|
||||
|
||||
test("offers to seed a repo that is not here when nothing has a page", () => {
|
||||
expect(target(`${rid}/tree/${oid}`, false)).toEqual({
|
||||
type: "missing",
|
||||
rid,
|
||||
url: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
test("opens the explorer for a page the app lacks", () => {
|
||||
expect(target(`${rid}/cob/dev.radicle.artifact/${oid}`)).toEqual({
|
||||
type: "external",
|
||||
|
||||
Reference in New Issue
Block a user