fix: dismiss active launcher window on Escape
This commit is contained in:
@@ -26,7 +26,7 @@ import Testing
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func translationCommandOpensToolAndEscapeRestoresSearch() throws {
|
||||
@Test @MainActor func translationCommandBackNavigationRestoresSearch() throws {
|
||||
_ = NSApplication.shared
|
||||
let launcher = LauncherWindowController()
|
||||
let content = try #require(launcher.window?.contentView)
|
||||
@@ -42,12 +42,6 @@ import Testing
|
||||
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.insertNewline(_:)))
|
||||
#expect(search.stringValue.isEmpty)
|
||||
#expect(search.accessibilityLabel() == "English text to translate into Japanese")
|
||||
search.stringValue = "Good morning"
|
||||
launcher.controlTextDidChange(Notification(name: NSControl.textDidChangeNotification, object: search))
|
||||
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.cancelOperation(_:)))
|
||||
#expect(search.stringValue == "translate")
|
||||
#expect(table.numberOfRows == 1)
|
||||
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.insertNewline(_:)))
|
||||
let back = try #require(descendants(content).compactMap { $0 as? NSButton }.first {
|
||||
!$0.isHidden && $0.accessibilityLabel() == "Back to applications"
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user