From 874fa7ad4d21e4ada100213ae8fd287f7dfd4748 Mon Sep 17 00:00:00 2001 From: nilvng Date: Sat, 2 Nov 2024 17:01:19 +1100 Subject: [PATCH] feat: add test --- pkg/cmd/pr/create/create_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/cmd/pr/create/create_test.go b/pkg/cmd/pr/create/create_test.go index 81684ff00f9..d3117499954 100644 --- a/pkg/cmd/pr/create/create_test.go +++ b/pkg/cmd/pr/create/create_test.go @@ -1714,6 +1714,19 @@ func Test_generateCompareURL(t *testing.T) { want: "https://github.com/OWNER/REPO/compare/main%2Ftrunk...owner:%21$&%27%28%29+%2C%3B=@?body=&expand=1", wantErr: false, }, + { + name: "with template", + ctx: CreateContext{ + BaseRepo: api.InitRepoHostname(&api.Repository{Name: "REPO", Owner: api.RepositoryOwner{Login: "OWNER"}}, "github.com"), + BaseBranch: "main", + HeadBranchLabel: "feature", + }, + state: shared.IssueMetadataState{ + Template: "story.md", + }, + want: "https://github.com/OWNER/REPO/compare/main...feature?body=&expand=1&template=story.md", + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {