From 87d659ca1a14fe8cf4871b8db0f42d005964f565 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 12 Jul 2024 12:37:10 +0200 Subject: app/windows: add basic main window --- app/tests/windows/main.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/tests/windows/main.cpp (limited to 'app/tests/windows/main.cpp') diff --git a/app/tests/windows/main.cpp b/app/tests/windows/main.cpp new file mode 100644 index 0000000..d2ad60e --- /dev/null +++ b/app/tests/windows/main.cpp @@ -0,0 +1,34 @@ +#include "turns/app/windows/main.hpp" + +#include + +#include + +#include +#include +#include + +using namespace std::string_literals; + +namespace turns::app::windows::tests +{ + + TEST_CASE("Newly constructed main window", "[windows]") + { + auto builder = Gtk::Builder::create_from_resource("/turns/windows/main_window.ui"); + auto instance = Gtk::Builder::get_widget_derived
(builder, "main_window"); + + SECTION("construction via builder succeeds") + { + REQUIRE(instance); + } + + SECTION("the window title is not empty") + { + auto widget = builder->get_widget("title"); + auto adw = ADW_WINDOW_TITLE(widget->gobj()); + REQUIRE(adw_window_title_get_subtitle(adw) != ""s); + } + } + +} // namespace turns::app::windows::tests \ No newline at end of file -- cgit v1.2.3