From 72ab1fb4c1bf363f46470816d8b914a78ac493c4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 24 May 2025 11:58:39 +0200 Subject: gui: restructure file layout and apply licenses --- gui/tests/tracker.cpp | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 gui/tests/tracker.cpp (limited to 'gui/tests/tracker.cpp') diff --git a/gui/tests/tracker.cpp b/gui/tests/tracker.cpp new file mode 100644 index 0000000..3d0b5a0 --- /dev/null +++ b/gui/tests/tracker.cpp @@ -0,0 +1,84 @@ +/* + * SPDX-FileCopyrightText: 2025 Felix Morgner + * SPDX-License-Identifier: LGPL-2.1-only + */ + +#include "turns/ui/tracker.hpp" + +#include "turns/core/settings.hpp" +#include "turns/lang/messages.hpp" + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +namespace turns::ui::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 app = Adwaita::Application::create("ch.arknet.Turns.test"); + auto instance = std::make_shared(app, core::get_settings()); + + SECTION("was successfully constructed") + { + REQUIRE(instance); + } + + // SECTION("has a non-empty subtitle") + // { + // auto widget = instance->get_ builder->get_widget("title"); + // REQUIRE_FALSE(widget->get_subtitle().empty()); + // } + + // SECTION("has its subtitle set according to the active language") + // { + // auto widget = builder->get_widget("title"); + // REQUIRE(widget->get_subtitle() == _(lang::no_active_turn_order)); + // } + + // SECTION("has a non-empty title") + // { + // auto widget = builder->get_widget("title"); + // REQUIRE_FALSE(widget->get_title().empty()); + // } + + // SECTION("has its title set according to the active language") + // { + // auto widget = builder->get_widget("title"); + // REQUIRE(widget->get_title() == _(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() == _(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() == _(lang::main_menu)); + // } + + // instance->destroy(); + // delete instance; + } + +} // namespace turns::ui::tests \ No newline at end of file -- cgit v1.2.3