feat(conversations): align custom attribute response
This commit is contained in:
@@ -327,13 +327,16 @@ func (s *ConversationHandlerTestSuite) TestUpdateCustomAttributes_Success() {
|
||||
assert.Equal(s.T(), http.StatusOK, w.Code)
|
||||
|
||||
var resp struct {
|
||||
ID uint `json:"id"`
|
||||
CustomAttributes map[string]interface{} `json:"custom_attributes"`
|
||||
}
|
||||
err := json.Unmarshal(w.Body.Bytes(), &resp)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.Equal(s.T(), s.testConv.ID, resp.ID)
|
||||
assert.Equal(s.T(), "vip_customer", resp.CustomAttributes["priority_reason"])
|
||||
var rawResp map[string]interface{}
|
||||
err = json.Unmarshal(w.Body.Bytes(), &rawResp)
|
||||
assert.NoError(s.T(), err)
|
||||
assert.NotContains(s.T(), rawResp, "id")
|
||||
assert.NotContains(s.T(), rawResp, "success")
|
||||
}
|
||||
|
||||
func (s *ConversationHandlerTestSuite) TestUpdateCustomAttributes_InvalidAccountID() {
|
||||
|
||||
Reference in New Issue
Block a user