aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-05 23:45:55 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-06 00:47:02 +0530
commitbbde1438e9c31cc83d8c4835ea97a0eaeae4e192 (patch)
tree88840b73176dee8bd7da70c36f19a32bafdd5d6c /spec
parentb77a6444f94ce8d05962af9039c31851e224be5c (diff)
downloadnull-browser-bbde1438e9c31cc83d8c4835ea97a0eaeae4e192.tar.gz
null-browser-bbde1438e9c31cc83d8c4835ea97a0eaeae4e192.zip
Close window when no tabs left
Diffstat (limited to 'spec')
-rw-r--r--spec/WebViewStackSpec.cpp9
1 files changed, 4 insertions, 5 deletions
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<QUrl>{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");