fix(tests): Remove duplicate analytics test with stale field expectations

The first GetReadingStats_WithAuth_DefaultDates test was expecting
'total_books' and 'total_reading_time' fields that don't exist in the
API response. The second duplicate test correctly expects
'total_books_read' and 'total_reading_time_minutes'.

This resolves the TestAnalyticsReadingStats failure.
This commit is contained in:
2026-02-10 13:30:14 -05:00
parent b2a3955c1e
commit 6e52e49169
-22
View File
@@ -25,28 +25,6 @@ func TestAnalyticsReadingStats(t *testing.T) {
assert.Equal(t, http.StatusUnauthorized, resp.StatusCode)
})
t.Run("GetReadingStats_WithAuth_DefaultDates", func(t *testing.T) {
setup := setupTestServer(t)
token := loginTestUser(t, setup.Server, setup.DB)
req, _ := http.NewRequest("GET", setup.Server.URL+"/api/analytics/reading-stats", nil)
req.Header.Set("Authorization", "Bearer "+token)
client := &http.Client{}
resp, err := client.Do(req)
require.NoError(t, err)
defer resp.Body.Close()
assert.Equal(t, http.StatusOK, resp.StatusCode)
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
assert.Contains(t, result, "total_books")
assert.Contains(t, result, "total_reading_time")
assert.Contains(t, result, "completion_rate")
assert.Contains(t, result, "daily_reading_minutes")
})
t.Run("GetReadingStats_WithAuth_DefaultDates", func(t *testing.T) {
setup := setupTestServer(t)