Testing the translation of "Go to the main page"

The new test fails since the "Go to the main page" button is not yet
internationalized.
This commit is contained in:
Veloman Yunkan 2022-01-30 21:28:06 +04:00 committed by Matthieu Gautier
parent f73be3cde7
commit ed7717c1e7
1 changed files with 23 additions and 5 deletions

View File

@ -533,11 +533,15 @@ std::string TestContentIn404HtmlResponse::taskbarLinks() const
if ( bookName.empty() )
return "";
return R"(<a id="kiwix_serve_taskbar_home_button" title="Go to the main page of ')"
+ bookTitle
+ R"('" aria-label="Go to the main page of ')"
+ bookTitle
+ R"('" href="/ROOT/)"
const auto goToMainPageOfBook = isTranslatedVersion()
? "Դեպի '" + bookTitle + "'֊ի գլխավոր էջը"
: "Go to the main page of '" + bookTitle + "'";
return R"(<a id="kiwix_serve_taskbar_home_button" title=")"
+ goToMainPageOfBook
+ R"(" aria-label=")"
+ goToMainPageOfBook
+ R"(" href="/ROOT/)"
+ bookName
+ R"(/"><button>)"
+ bookTitle
@ -692,6 +696,20 @@ TEST_F(ServerTest, 404WithBodyTesting)
</p>
)" },
{ /* url */ "/ROOT/zimfile/invalid-article?userlang=hy",
expected_page_title=="Սխալ հասցե" &&
book_name=="zimfile" &&
book_title=="Ray Charles" &&
expected_body==R"(
<h1>Սխալ հասցե</h1>
<p>
Սխալ հասցե՝ /ROOT/zimfile/invalid-article
</p>
<p>
Make a full text search for <a href="/ROOT/search?content=zimfile&pattern=invalid-article">invalid-article</a>
</p>
)" },
{ /* url */ "/ROOT/raw/no-such-book/meta/Title",
expected_body==R"(
<h1>Not Found</h1>