diff --git a/backend/internal/handler/api/v1/conversation_handler_test.go b/backend/internal/handler/api/v1/conversation_handler_test.go index 1d1f04c5..7ddf5471 100644 --- a/backend/internal/handler/api/v1/conversation_handler_test.go +++ b/backend/internal/handler/api/v1/conversation_handler_test.go @@ -878,7 +878,9 @@ func (s *ConversationHandlerTestSuite) TestUpdateLastSeen_SuccessMarksNotificati req, _ := http.NewRequest("POST", fmt.Sprintf("/api/v1/accounts/%d/conversations/%d/update_last_seen", s.testAccount.ID, s.testConv.ID), nil) s.router.ServeHTTP(w, req) assert.Equal(s.T(), http.StatusOK, w.Code) - assert.Empty(s.T(), w.Body.String()) + var response chatwootConversationPayload + s.Require().NoError(json.Unmarshal(w.Body.Bytes(), &response)) + assert.Equal(s.T(), s.testConv.ID, response.ID) var conversation model.Conversation s.Require().NoError(s.db.First(&conversation, s.testConv.ID).Error) @@ -905,7 +907,9 @@ func (s *ConversationHandlerTestSuite) TestUpdateLastSeen_DisplayIDRouteMarksNot s.router.ServeHTTP(w, req) assert.Equal(s.T(), http.StatusOK, w.Code) - assert.Empty(s.T(), w.Body.String()) + var response chatwootConversationPayload + s.Require().NoError(json.Unmarshal(w.Body.Bytes(), &response)) + assert.Equal(s.T(), displayID, response.ID) var conversation model.Conversation s.Require().NoError(s.db.First(&conversation, s.testConv.ID).Error)