Fix pointer dereferencing in Update RPC handler (#223)
- Dereference Design, AcceptanceCriteria, Notes, and Assignee pointers in updatesFromArgs - Fixes EOF errors when using --notes, --design, --assignee, or --acceptance-criteria flags - Enhance TestUpdateIssue to verify all pointer-dereferenced fields are correctly stored
This commit is contained in:
@@ -213,9 +213,18 @@ func TestUpdateIssue(t *testing.T) {
|
||||
json.Unmarshal(createResp.Data, &issue)
|
||||
|
||||
newTitle := "Updated Title"
|
||||
notes := "Some important notes"
|
||||
design := "Design details"
|
||||
assignee := "alice"
|
||||
acceptance := "Acceptance criteria"
|
||||
|
||||
updateArgs := &UpdateArgs{
|
||||
ID: issue.ID,
|
||||
Title: &newTitle,
|
||||
ID: issue.ID,
|
||||
Title: &newTitle,
|
||||
Notes: ¬es,
|
||||
Design: &design,
|
||||
Assignee: &assignee,
|
||||
AcceptanceCriteria: &acceptance,
|
||||
}
|
||||
|
||||
updateResp, err := client.Update(updateArgs)
|
||||
@@ -229,6 +238,18 @@ func TestUpdateIssue(t *testing.T) {
|
||||
if updatedIssue.Title != newTitle {
|
||||
t.Errorf("Expected title %s, got %s", newTitle, updatedIssue.Title)
|
||||
}
|
||||
if updatedIssue.Notes != notes {
|
||||
t.Errorf("Expected notes %s, got %s", notes, updatedIssue.Notes)
|
||||
}
|
||||
if updatedIssue.Design != design {
|
||||
t.Errorf("Expected design %s, got %s", design, updatedIssue.Design)
|
||||
}
|
||||
if updatedIssue.Assignee != assignee {
|
||||
t.Errorf("Expected assignee %s, got %s", assignee, updatedIssue.Assignee)
|
||||
}
|
||||
if updatedIssue.AcceptanceCriteria != acceptance {
|
||||
t.Errorf("Expected acceptance criteria %s, got %s", acceptance, updatedIssue.AcceptanceCriteria)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCloseIssue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user