diff --git a/pkg/cmd/issue/shared/lookup_test.go b/pkg/cmd/issue/shared/lookup_test.go index 694a3fd05..44f496de4 100644 --- a/pkg/cmd/issue/shared/lookup_test.go +++ b/pkg/cmd/issue/shared/lookup_test.go @@ -79,6 +79,23 @@ func TestIssueFromArgWithFields(t *testing.T) { wantIssue: 13, wantRepo: "https://example.org/OWNER/REPO", }, + { + name: "PR URL argument", + args: args{ + selector: "https://example.org/OWNER/REPO/pull/13#comment-123", + baseRepoFn: nil, + }, + httpStub: func(r *httpmock.Registry) { + r.Register( + httpmock.GraphQL(`query IssueByNumber\b`), + httpmock.StringResponse(`{"data":{"repository":{ + "hasIssuesEnabled": true, + "issue":{"number":13} + }}}`)) + }, + wantIssue: 13, + wantRepo: "https://example.org/OWNER/REPO", + }, { name: "project cards permission issue", args: args{