summaryrefslogtreecommitdiff
path: root/app/tests/windows/main.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-12 12:37:10 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-12 12:37:10 +0200
commit87d659ca1a14fe8cf4871b8db0f42d005964f565 (patch)
tree704e94d644d2f27d474fdc211894cf0ab88614e4 /app/tests/windows/main.cpp
parent61ba5c151040533f23642c07fc2230a5718396ee (diff)
downloadturns-87d659ca1a14fe8cf4871b8db0f42d005964f565.tar.xz
turns-87d659ca1a14fe8cf4871b8db0f42d005964f565.zip
app/windows: add basic main window
Diffstat (limited to 'app/tests/windows/main.cpp')
-rw-r--r--app/tests/windows/main.cpp34
1 files changed, 34 insertions, 0 deletions
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 <catch2/catch_test_macros.hpp>
+
+#include <string>
+
+#include <adwaita.h>
+#include <gtkmm/builder.h>
+#include <gtkmm/widget.h>
+
+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<main>(builder, "main_window");
+
+ SECTION("construction via builder succeeds")
+ {
+ REQUIRE(instance);
+ }
+
+ SECTION("the window title is not empty")
+ {
+ auto widget = builder->get_widget<Gtk::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