diff options
Diffstat (limited to 'app/tests')
| -rw-r--r-- | app/tests/windows/main.cpp | 34 |
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 |
