Files
qbz/scripts/qml-tests/tst_quit_confirmation.qml
T
vicrodh 2fc03d325d fix(qt): restore window lifecycle and improve grid artwork
Restore tray-aware close and quit confirmation, circular label covers, and missing label artist portraits. Publish artwork progressively, preload two grid rows, and skip redundant motion reports while preserving data refreshes.

Include regression tests and isolated artwork benchmarks. Verified Linux build, QML checks, and scrolling smoke tests.

cx
2026-09-09 21:58:25 -06:00

50 lines
1.5 KiB
QML

import QtQuick
import QtTest
import "../../crates/qbz-qt/qml/controls" as Controls
Item {
width: 800
height: 600
Controls.QbzConfirmModal {
id: modal
anchors.fill: parent
title: "Close QBZ?"
confirmLabel: "Yes"
cancelLabel: "No"
checkboxLabel: "Don't show again"
danger: false
}
SignalSpy { id: confirmed; target: modal; signalName: "confirmed" }
SignalSpy { id: cancelled; target: modal; signalName: "cancelled" }
TestCase {
name: "QuitConfirmation"
when: windowShown
function init() {
confirmed.clear(); cancelled.clear()
modal.checkboxChecked = false
modal.open()
wait(30)
}
function cleanup() { modal.close() }
function test_escape_cancels_without_confirming() {
keyClick(Qt.Key_Escape)
compare(cancelled.count, 1)
compare(confirmed.count, 0)
verify(!modal.opened)
}
function test_initial_enter_is_no() {
keyClick(Qt.Key_Return)
compare(cancelled.count, 1)
compare(confirmed.count, 0)
}
function test_keyboard_yes_preserves_checkbox_for_handler() {
modal.checkboxChecked = true
keyClick(Qt.Key_Tab)
keyClick(Qt.Key_Return)
compare(confirmed.count, 1)
compare(cancelled.count, 0)
verify(modal.checkboxChecked)
verify(!modal.opened)
}
}
}