Skip to content

Commit 0accf2e

Browse files
fix: test toggle status
1 parent ee63d4f commit 0accf2e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

backend/internal/app/handlers_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ func TestToggleStatus(t *testing.T) {
163163
t.Errorf("Expected status code %d, got %d", http.StatusOK, w.Code)
164164
}
165165

166-
var response map[string]bool
167-
json.Unmarshal(w.Body.Bytes(), &response)
168-
169-
if !response["isOpen"] {
170-
t.Error("Expected status to be toggled to open (true)")
166+
responseBody := w.Body.String()
167+
if responseBody != "true" {
168+
t.Errorf("Expected status to be toggled to open (true), got: %s", responseBody)
171169
}
172170
})
173171

0 commit comments

Comments
 (0)