From e3fffd9b234eb83ad2719d20b6876e312785da8d Mon Sep 17 00:00:00 2001
From: Veloman Yunkan
Date: Tue, 5 Mar 2024 17:18:31 +0400
Subject: [PATCH] Negative tests for books selection during search
---
test/server_search.cpp | 69 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 65 insertions(+), 4 deletions(-)
diff --git a/test/server_search.cpp b/test/server_search.cpp
index 06f35aba7..4759a0c36 100644
--- a/test/server_search.cpp
+++ b/test/server_search.cpp
@@ -1572,7 +1572,10 @@ TEST(ServerSearchTest, searchResults)
}
}
-std::string expectedConfusionOfTonguesErrorHtml(std::string url)
+std::string invalidRequestErrorHtml(std::string url,
+ std::string errorMsgId,
+ std::string errorMsgParamsJSON,
+ std::string errorText)
{
return R"(
@@ -1581,7 +1584,7 @@ std::string expectedConfusionOfTonguesErrorHtml(std::string url)
Invalid request
@@ -1590,19 +1593,30 @@ std::string expectedConfusionOfTonguesErrorHtml(std::string url)
The requested URL ")" + url + R"(" is not a valid request.
- Two or more books in different languages would participate in search, which may lead to confusing results.
+ )" + errorText + R"(