Analytics: - Reading stats endpoint tests - Device usage tests - Popular books tests Books: - Bulk delete tests - Bulk update tests Collections: - Bulk add books to collections tests Conflicts: - Bulk resolve conflicts tests - Bulk dismiss conflicts tests - Bulk resolve highest progress tests All tests cover no user, user, and admin contexts
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
{
|
|
"meta": {
|
|
"name": "Get Reading Stats",
|
|
"type": "http",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"// Test reading stats response",
|
|
"if (response.status === 200) {",
|
|
" tests['Reading stats loaded'] = true;",
|
|
" const body = JSON.parse(response.body);",
|
|
" tests['Has total_books_read'] = body.total_books_read !== undefined;",
|
|
" tests['Has total_pages_read'] = body.total_pages_read !== undefined;",
|
|
" tests['Has total_reading_time_minutes'] = body.total_reading_time_minutes !== undefined;",
|
|
" tests['Has completion_rate'] = body.completion_rate !== undefined;",
|
|
" tests['Has daily_reading_minutes array'] = Array.isArray(body.daily_reading_minutes);",
|
|
"} else {",
|
|
" tests['Reading stats failed'] = false;",
|
|
"}"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"req": {
|
|
"url": "{{baseUrl}}/api/analytics/reading-stats",
|
|
"method": "GET",
|
|
"headers": {
|
|
"Authorization": "Bearer {{authToken}}"
|
|
}
|
|
}
|
|
}
|