From 2ea5f03b43db7a8eb33bf44b31969ecb341fc5ae Mon Sep 17 00:00:00 2001 From: t4kamura Date: Mon, 18 Mar 2024 22:49:07 +0900 Subject: [PATCH] Test pr url lock --- pkg/cmd/issue/shared/lookup_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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{