From b75c4a812d89d65312567deca2046d8b32feaba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 12 May 2020 16:49:04 +0200 Subject: [PATCH] Guard against leaked parameters in issue/pr create tests --- command/issue_test.go | 6 ++++++ command/pr_create_test.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/command/issue_test.go b/command/issue_test.go index c3a83b75a..3df6910f5 100644 --- a/command/issue_test.go +++ b/command/issue_test.go @@ -556,6 +556,12 @@ func TestIssueCreate_metadata(t *testing.T) { eq(t, inputs["labelIds"], []interface{}{"BUGID", "TODOID"}) eq(t, inputs["projectIds"], []interface{}{"ROADMAPID"}) eq(t, inputs["milestoneId"], "BIGONEID") + if v, ok := inputs["userIds"]; ok { + t.Errorf("did not expect userIds: %v", v) + } + if v, ok := inputs["teamIds"]; ok { + t.Errorf("did not expect teamIds: %v", v) + } })) output, err := RunCommand(`issue create -t TITLE -b BODY -a monalisa -l bug -l todo -p roadmap -m 'big one.oh'`) diff --git a/command/pr_create_test.go b/command/pr_create_test.go index 7f1b772a4..18a54e887 100644 --- a/command/pr_create_test.go +++ b/command/pr_create_test.go @@ -141,6 +141,12 @@ func TestPRCreate_metadata(t *testing.T) { `, func(inputs map[string]interface{}) { eq(t, inputs["title"], "TITLE") eq(t, inputs["body"], "BODY") + if v, ok := inputs["assigneeIds"]; ok { + t.Errorf("did not expect assigneeIds: %v", v) + } + if v, ok := inputs["userIds"]; ok { + t.Errorf("did not expect userIds: %v", v) + } })) http.Register( httpmock.GraphQL(`\bupdatePullRequest\(`),