From d2fedf9123f91dac04a28d388a7cec663cbbd352 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Fri, 5 Jan 2024 18:42:42 +0400 Subject: [PATCH] Added error details in testing of error responses --- test/response.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test/response.cpp b/test/response.cpp index 5b9d8c92a..5762f8319 100644 --- a/test/response.cpp +++ b/test/response.cpp @@ -32,6 +32,12 @@ TEST(HTTPErrorResponse, shouldBeInEnglishByDefault) { "/css/error.css", /*includeKiwixResponseData=*/true); + errResp += ParameterizedMessage("suggest-search", + { + { "PATTERN", "asdf" }, + { "SEARCH_URL", "/search?q=asdf" } + }); + EXPECT_EQ(getResponseContent(errResp), R"( @@ -40,12 +46,14 @@ R"( Content not found

Not Found

- +

+ Make a full text search for asdf +

)"); @@ -63,6 +71,12 @@ TEST(HTTPErrorResponse, shouldBeTranslatable) { "/css/error.css", /*includeKiwixResponseData=*/true); + errResp += ParameterizedMessage("suggest-search", + { + { "PATTERN", "asdf" }, + { "SEARCH_URL", "/search?q=asdf" } + }); + EXPECT_EQ(getResponseContent(errResp), R"( @@ -71,12 +85,14 @@ R"( [I18N TESTING] Not Found - Try Again

[I18N TESTING] Content not found, but at least the server is alive

- +

+ [I18N TESTING] Make a full text search for asdf +

)");