Skip to content

Commit

Permalink
extend existing create issue test for affects version
Browse files Browse the repository at this point in the history
  • Loading branch information
damianoneill authored and ankitpokhrel committed Aug 16, 2023
1 parent 017d8d1 commit 496871f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/jira/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,23 @@ func (c *createTestServer) statusCode(code int) {
func TestCreate(t *testing.T) {
expectedBody := `{"update":{},"fields":{"project":{"key":"TEST"},"issuetype":{"name":"Bug"},` +
`"summary":"Test bug","description":"Test description","priority":{"name":"Normal"},"labels":["test","dev"],` +
`"components":[{"name":"BE"},{"name":"FE"}],"fixVersions":[{"name":"v2.0"},{"name":"v2.1-hotfix"}]}}`
`"components":[{"name":"BE"},{"name":"FE"}],"fixVersions":[{"name":"v2.0"},{"name":"v2.1-hotfix"}],"versions":[{"name":"v3.0"},{"name":"v3.1-hotfix"}]}}`
testServer := createTestServer{code: 201}
server := testServer.serve(t, expectedBody)
defer server.Close()

client := NewClient(Config{Server: server.URL}, WithTimeout(3*time.Second))

requestData := CreateRequest{
Project: "TEST",
IssueType: "Bug",
Summary: "Test bug",
Body: "Test description",
Priority: "Normal",
Labels: []string{"test", "dev"},
Components: []string{"BE", "FE"},
FixVersions: []string{"v2.0", "v2.1-hotfix"},
Project: "TEST",
IssueType: "Bug",
Summary: "Test bug",
Body: "Test description",
Priority: "Normal",
Labels: []string{"test", "dev"},
Components: []string{"BE", "FE"},
FixVersions: []string{"v2.0", "v2.1-hotfix"},
AffectsVersions: []string{"v3.0", "v3.1-hotfix"},
}
actual, err := client.CreateV2(&requestData)
assert.NoError(t, err)
Expand Down

0 comments on commit 496871f

Please sign in to comment.