From 4d0a7d99ebf55ad2d0e583759699b8b4d77a7907 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 24 Jul 2024 13:23:55 +0200 Subject: app: move ui code to ui library --- app/tests/windows/tracker.cpp | 75 ------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 app/tests/windows/tracker.cpp (limited to 'app/tests/windows/tracker.cpp') diff --git a/app/tests/windows/tracker.cpp b/app/tests/windows/tracker.cpp deleted file mode 100644 index 3d7f0c2..0000000 --- a/app/tests/windows/tracker.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "turns/app/windows/tracker.hpp" - -#include "turns/lang/messages.hpp" - -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -namespace turns::app::windows::tests -{ - - TEST_CASE("A freshly constructed tracker window", "[windows]") - { - auto locale = GENERATE("en_US.UTF-8", "de_CH.UTF-8"); - setlocale(LC_ALL, locale); - - auto builder = Gtk::Builder::create_from_resource("/ch/arknet/Turns/windows/tracker.ui"); - auto instance = Gtk::Builder::get_widget_derived(builder, "tracker"); - - SECTION("was successfully constructed") - { - REQUIRE(instance); - } - - 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("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("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("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("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("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)}); - } - } - -} // namespace turns::app::windows::tests \ No newline at end of file -- cgit v1.2.3