Skip to content

Commit

Permalink
Added tests for parse request type & fixed test naming (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fank authored Jul 20, 2024
1 parent a9d0768 commit acdd94c
Show file tree
Hide file tree
Showing 3 changed files with 598 additions and 63 deletions.
1 change: 1 addition & 0 deletions pkg/infra/models/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ var (
ErrNoCheckBoxTypeError = errors.New("custom-field: no check-box type set")
ErrNoCascadingParentError = errors.New("custom-field: no cascading parent value set")
ErrNoCascadingChildError = errors.New("custom-field: no cascading child value set")
ErrNoRequestTypeError = errors.New("custom-field: no request type value set")
ErrNoTempoAccountTypeError = errors.New("custom-field: no tempo account value set")
ErrNoAttachmentIdsError = errors.New("sm: no attachment id's set")
ErrNoLabelsError = errors.New("sm: no label names set")
Expand Down
4 changes: 2 additions & 2 deletions pkg/infra/models/jira_issue_custom_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -1855,12 +1855,12 @@ func ParseRequestTypeCustomField(buffer bytes.Buffer, customField string) (*Cust
// Check if the issue iteration contains information on the customfield selected,
// if not, continue
if raw.Get(path).Type == gjson.Null {
return nil, ErrNoAssetTypeError
return nil, ErrNoRequestTypeError
}

var requestType *CustomFieldRequestTypeScheme
if err := json.Unmarshal([]byte(raw.Get(path).String()), &requestType); err != nil {
return nil, ErrNoAssetTypeError
return nil, ErrNoRequestTypeError
}

return requestType, nil
Expand Down
Loading

0 comments on commit acdd94c

Please sign in to comment.