From 3262b3a337759439f3049b9299be12baf8420750 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 15 Jul 2024 22:26:12 +0200 Subject: turns: add more tests --- app/tests/windows/main.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'app/tests/windows/main.cpp') diff --git a/app/tests/windows/main.cpp b/app/tests/windows/main.cpp index 8661153..a04a130 100644 --- a/app/tests/windows/main.cpp +++ b/app/tests/windows/main.cpp @@ -12,13 +12,14 @@ #include #include #include +#include #include #include namespace turns::app::windows::tests { - TEST_CASE("Newly constructed main window", "[windows]") + TEST_CASE("A freshly constructed main window", "[windows]") { auto locale = GENERATE("en_US.UTF-8", "de_CH.UTF-8"); setlocale(LC_ALL, locale); @@ -26,46 +27,46 @@ namespace turns::app::windows::tests auto builder = Gtk::Builder::create_from_resource("/ch/arknet/Turns/windows/main.ui"); auto instance = Gtk::Builder::get_widget_derived
(builder, "main"); - SECTION("construction via builder succeeds") + SECTION("was successfully constructed") { REQUIRE(instance); } - SECTION("the window sub-title is not empty") + SECTION("has a non-empty subtitle") { auto widget = builder->get_widget("title"); auto adw = ADW_WINDOW_TITLE(widget->gobj()); REQUIRE(adw_window_title_get_subtitle(adw)); } - SECTION("the window sub-title is set according to the active language") + SECTION("has its subtitle set according to the active language") { auto widget = builder->get_widget("title"); auto adw = ADW_WINDOW_TITLE(widget->gobj()); REQUIRE(adw_window_title_get_subtitle(adw) == Glib::ustring{_(lang::no_active_turn_order)}); } - SECTION("the window title is not empty") + SECTION("has a non-empty title") { auto widget = builder->get_widget("title"); auto adw = ADW_WINDOW_TITLE(widget->gobj()); REQUIRE(adw_window_title_get_title(adw)); } - SECTION("the window title is set according to the active language") + SECTION("has its title set according to the active language") { auto widget = builder->get_widget("title"); auto adw = ADW_WINDOW_TITLE(widget->gobj()); REQUIRE(adw_window_title_get_title(adw) == Glib::ustring{_(lang::turns)}); } - SECTION("the add_participant button has the correct tooltip") + SECTION("has its add_participant button's tooltip set according to the active language") { auto widget = builder->get_widget("add_participant"); REQUIRE(widget->get_tooltip_text() == Glib::ustring{_(lang::add_participant)}); } - SECTION("the open_main_menu button has the correct tooltip") + SECTION("as its open_main_menu button's tooltip set according to the active language") { auto widget = builder->get_widget("open_main_menu"); REQUIRE(widget->get_tooltip_text() == Glib::ustring{_(lang::main_menu)}); -- cgit v1.2.3