fix: ctrl-q now properly exits

This commit is contained in:
2026-07-15 19:17:21 +02:00
parent 48e0903542
commit c77686250e
4 changed files with 37 additions and 5 deletions

View File

@@ -132,4 +132,20 @@ defmodule BDS.TUITest do
test "quit key stops the app" do
assert {:stop, _state} = BDS.TUI.handle_event(key("q", ["ctrl"]), mount!())
end
test "local tui mode stops the VM when the app exits" do
parent = self()
state = mount!(stop_vm_on_exit: true, stop_fun: fn -> send(parent, :vm_stopped) end)
assert :ok = BDS.TUI.terminate(:normal, state)
assert_receive :vm_stopped
end
test "ssh-served sessions never stop the VM on exit" do
parent = self()
state = mount!(stop_fun: fn -> send(parent, :vm_stopped) end)
assert :ok = BDS.TUI.terminate(:normal, state)
refute_receive :vm_stopped, 100
end
end