#2687 HistoryTableViewTest uses the platform copy shortcut so it passes on macOS

HistoryTableView matches SHORTCUT_DOWN+C, which JavaFX maps to Cmd-C on macOS. The test always fired Ctrl-C, so the copy never triggered on the macOS CI runner and the clipboard assertion failed. The test now fires Meta-C on macOS and Ctrl-C elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
denny
2026-11-19 03:04:15 -05:00
parent 6d89a604c3
commit 291853c32e

View File

@@ -76,9 +76,11 @@ public class HistoryTableViewTest
table.getSelectionModel().select(0); table.getSelectionModel().select(0);
table.getSelectionModel().select(2); table.getSelectionModel().select(2);
//The copy shortcut is Cmd-C (meta) on macOS and Ctrl-C elsewhere
boolean mac = System.getProperty("os.name", "").toLowerCase().startsWith("mac");
Clipboard.getSystemClipboard().clear(); Clipboard.getSystemClipboard().clear();
Event.fireEvent(table, new KeyEvent(KeyEvent.KEY_PRESSED, "", "", KeyCode.C, false, Event.fireEvent(table, new KeyEvent(KeyEvent.KEY_PRESSED, "", "", KeyCode.C, false,
true, false, false)); !mac, false, mac));
copied.complete(Clipboard.getSystemClipboard().getString()); copied.complete(Clipboard.getSystemClipboard().getString());
} }
catch(Throwable t) catch(Throwable t)