Skip to content

Commit eca15ab

Browse files
AnnatarHeclaude
andcommitted
fix(model): update api tests to use JSON instead of msgpack
Update test assertions to verify JSON content type instead of msgpack, aligning with the recent change to use JSON as default HTTP send method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bfcf097 commit eca15ab

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

model/api_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package model
22

33
import (
44
"context"
5+
"encoding/json"
56
"net/http"
67
"net/http/httptest"
78
"testing"
89
"time"
910

1011
"github.com/stretchr/testify/assert"
1112
"github.com/stretchr/testify/suite"
12-
"github.com/vmihailenco/msgpack/v5"
1313
)
1414

1515
type apiTestSuite struct {
@@ -21,13 +21,13 @@ func (s *apiTestSuite) TestDoSendData() {
2121
s.T().Run("successful request", func(t *testing.T) {
2222
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2323
// Verify headers
24-
assert.Equal(t, "application/msgpack", r.Header.Get("Content-Type"))
24+
assert.Equal(t, "application/json", r.Header.Get("Content-Type"))
2525
assert.Contains(t, r.Header.Get("User-Agent"), "shelltimeCLI@")
2626
assert.Equal(t, "CLI testToken", r.Header.Get("Authorization"))
2727

2828
// Decode request body
2929
var payload PostTrackArgs
30-
err := msgpack.NewDecoder(r.Body).Decode(&payload)
30+
err := json.NewDecoder(r.Body).Decode(&payload)
3131
assert.NoError(t, err)
3232

3333
// Verify payload

0 commit comments

Comments
 (0)