From 511261cc81b03b1dace7b61d3bef5ba2da83c42d Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sun, 30 Jan 2022 15:59:17 +0400 Subject: [PATCH] Testing of "Fulltext search unavailable" page --- static/skin/search_results.css | 1 + static/templates/no_search_result.html | 4 ++-- test/server.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/static/skin/search_results.css b/static/skin/search_results.css index df3a54c04..8fb0a84b1 100644 --- a/static/skin/search_results.css +++ b/static/skin/search_results.css @@ -1,4 +1,5 @@ body{ +background-color: white; color: #000000; font: small/normal Arial,Helvetica,Sans-Serif; margin-top: 0.5em; diff --git a/static/templates/no_search_result.html b/static/templates/no_search_result.html index 5105e200c..baa7aa2c7 100644 --- a/static/templates/no_search_result.html +++ b/static/templates/no_search_result.html @@ -1,11 +1,11 @@ - + Fulltext search unavailable - +
Not found

There is no article with the title "{{pattern}}" diff --git a/test/server.cpp b/test/server.cpp index a011f1d33..4eb22e063 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -662,6 +662,30 @@ TEST_F(ServerTest, 404WithBodyTesting) Cannot find content entry invalid-article

)" }, + + { /* url */ "/ROOT/search?content=zimfile", + expected_page_title=="Fulltext search unavailable" && + expected_css_url=="/ROOT/skin/search_results.css" && + book_name=="zimfile" && + book_title=="Ray Charles" && + expected_body==R"( +
Not found
+

+ There is no article with the title "" + and the fulltext search engine is not available for this content. +

+)" }, + + { /* url */ "/ROOT/search?content=non-existent-book&pattern=asdfqwerty", + expected_page_title=="Fulltext search unavailable" && + expected_css_url=="/ROOT/skin/search_results.css" && + expected_body==R"( +
Not found
+

+ There is no article with the title "asdfqwerty" + and the fulltext search engine is not available for this content. +

+)" }, }; for ( const auto& t : testData ) {