Tests: Add tests that both /api/history and /api/history/clients return full 24h data

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-11-08 09:47:08 +01:00
parent ac534ecfb6
commit 5da282eb8d
+12
View File
@@ -1292,6 +1292,18 @@
[[ ${lines[0]} == '"xn--bc-uia.com"' ]]
}
@test "API history: Returns full 24 hours even if only a few queries are made" {
run bash -c 'curl -s 127.0.0.1/api/history | jq ".history | length"'
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} == "145" ]]
}
@test "API history/clients: Returns full 24 hours even if only a few queries are made" {
run bash -c 'curl -s 127.0.0.1/api/history/clients | jq ".history | length"'
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} == "145" ]]
}
@test "API authorization (without password): No login required" {
run bash -c 'curl -s 127.0.0.1/api/auth'
printf "%s\n" "${lines[@]}"