From bbde1438e9c31cc83d8c4835ea97a0eaeae4e192 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 5 Apr 2025 23:45:55 +0530 Subject: Close window when no tabs left --- spec/WebViewStackSpec.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/WebViewStackSpec.cpp b/spec/WebViewStackSpec.cpp index 0559b43..0563a5f 100644 --- a/spec/WebViewStackSpec.cpp +++ b/spec/WebViewStackSpec.cpp @@ -132,18 +132,17 @@ private slots: context("when close is called on current webview"); context("- and there is only 1 tab"); - it("closes the tab and opens empty tab in its place") { + it("requests closing window") { Configuration configuration; WebViewStack webview_stack(&configuration); + QSignalSpy close_window_requested_spy(&webview_stack, &WebViewStack::close_window_requested); webview_stack.open_url(QUrl("https://a.com")); QCOMPARE(webview_stack.count(), 1); webview_stack.close(webview_stack.current_webview_id()); + close_window_requested_spy.wait(100); - QCOMPARE(webview_stack.count(), 1); - QCOMPARE(webview_stack.urls(), (std::vector{configuration.new_tab_url})); - QCOMPARE(webview_stack.current_webview_index(), 0); - QCOMPARE(webview_stack.current_url(), configuration.new_tab_url); + QCOMPARE(close_window_requested_spy.count(), 1); } context("when close is called"); -- cgit v1.3.1