From 843e6f28599ddf67db11d58a1833cb720544828e Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Mon, 12 Oct 2026 21:16:08 +0700 Subject: [PATCH] test(coordinator): fix the chrome snapshot build and re-record it --- TableProTests/Core/Menu/ChromeSnapshot.json | 52 +++++++++---------- .../Core/Menu/ChromeSnapshotTests.swift | 15 +----- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/TableProTests/Core/Menu/ChromeSnapshot.json b/TableProTests/Core/Menu/ChromeSnapshot.json index 01f51f6556..687191d302 100644 --- a/TableProTests/Core/Menu/ChromeSnapshot.json +++ b/TableProTests/Core/Menu/ChromeSnapshot.json @@ -63,7 +63,6 @@ {"path": "File", "separator": true}, {"path": "File > Backup Dump…", "action": "backupDatabase:"}, {"path": "File > Restore Dump…", "action": "restoreDatabase:"}, - {"path": "File > Server-Side Export…", "action": "serverSideExport:"}, {"path": "Edit"}, {"path": "Edit > Undo", "identifier": "shortcut.undo", "action": "undo:", "key": "z", "modifiers": ["command"]}, {"path": "Edit > Redo", "identifier": "shortcut.redo", "action": "redo:", "key": "z", "modifiers": ["shift", "command"]}, @@ -96,35 +95,35 @@ {"path": "Edit", "separator": true}, {"path": "Edit > Restore Previous Values…", "identifier": "shortcut.restorePreviousValues", "action": "restorePreviousValues:"}, {"path": "Edit", "separator": true}, - {"path": "Edit > Data"}, - {"path": "Edit > Data > Insert Row Above", "action": "dataFileInsertRowAbove:"}, - {"path": "Edit > Data > Insert Row Below", "action": "dataFileInsertRowBelow:"}, - {"path": "Edit > Data > Delete Rows", "action": "dataFileDeleteSelectedRows:"}, + {"path": "Edit > Data", "identifier": "edit.data", "hidden": true}, + {"path": "Edit > Data > Insert Row Above", "action": "dataFileInsertRowAbove:", "hidden": true}, + {"path": "Edit > Data > Insert Row Below", "action": "dataFileInsertRowBelow:", "hidden": true}, + {"path": "Edit > Data > Delete Rows", "action": "dataFileDeleteSelectedRows:", "hidden": true}, {"path": "Edit > Data", "separator": true}, - {"path": "Edit > Data > Add Column…", "action": "dataFileAddColumn:"}, - {"path": "Edit > Data > Insert Column Left", "action": "dataFileInsertColumnLeft:"}, - {"path": "Edit > Data > Insert Column Right", "action": "dataFileInsertColumnRight:"}, - {"path": "Edit > Data > Rename Column…", "action": "dataFileRenameColumn:"}, - {"path": "Edit > Data > Split Column…", "action": "dataFileSplitColumn:"}, - {"path": "Edit > Data > Merge Columns…", "action": "dataFileMergeColumns:"}, - {"path": "Edit > Data > Delete Column", "action": "dataFileDeleteColumn:"}, + {"path": "Edit > Data > Add Column…", "action": "dataFileAddColumn:", "hidden": true}, + {"path": "Edit > Data > Insert Column Left", "action": "dataFileInsertColumnLeft:", "hidden": true}, + {"path": "Edit > Data > Insert Column Right", "action": "dataFileInsertColumnRight:", "hidden": true}, + {"path": "Edit > Data > Rename Column…", "action": "dataFileRenameColumn:", "hidden": true}, + {"path": "Edit > Data > Split Column…", "action": "dataFileSplitColumn:", "hidden": true}, + {"path": "Edit > Data > Merge Columns…", "action": "dataFileMergeColumns:", "hidden": true}, + {"path": "Edit > Data > Delete Column", "action": "dataFileDeleteColumn:", "hidden": true}, {"path": "Edit > Data", "separator": true}, - {"path": "Edit > Data > Fill Down", "action": "dataFileFillDown:"}, - {"path": "Edit > Data > Set Cells to Value…", "action": "dataFileSetCellsToValue:"}, - {"path": "Edit > Data > Trim Whitespace", "action": "dataFileTrimWhitespace:"}, - {"path": "Edit > Data > Change Case"}, - {"path": "Edit > Data > Change Case > UPPERCASE", "action": "dataFileChangeCase:"}, - {"path": "Edit > Data > Change Case > lowercase", "action": "dataFileChangeCase:"}, - {"path": "Edit > Data > Change Case > Title Case", "action": "dataFileChangeCase:"}, - {"path": "Edit > Data > Replace in Column…", "action": "dataFileReplaceInColumn:"}, - {"path": "Edit > Data > Remove Duplicate Rows…", "action": "dataFileRemoveDuplicates:"}, + {"path": "Edit > Data > Fill Down", "action": "dataFileFillDown:", "hidden": true}, + {"path": "Edit > Data > Set Cells to Value…", "action": "dataFileSetCellsToValue:", "hidden": true}, + {"path": "Edit > Data > Trim Whitespace", "action": "dataFileTrimWhitespace:", "hidden": true}, + {"path": "Edit > Data > Change Case", "hidden": true}, + {"path": "Edit > Data > Change Case > UPPERCASE", "action": "dataFileChangeCase:", "hidden": true}, + {"path": "Edit > Data > Change Case > lowercase", "action": "dataFileChangeCase:", "hidden": true}, + {"path": "Edit > Data > Change Case > Title Case", "action": "dataFileChangeCase:", "hidden": true}, + {"path": "Edit > Data > Replace in Column…", "action": "dataFileReplaceInColumn:", "hidden": true}, + {"path": "Edit > Data > Remove Duplicate Rows…", "action": "dataFileRemoveDuplicates:", "hidden": true}, {"path": "Edit > Data", "separator": true}, - {"path": "Edit > Data > Column Statistics…", "action": "dataFileShowStatistics:"}, - {"path": "Edit > Data > Search All Columns", "action": "dataFileSearchAllColumns:"}, + {"path": "Edit > Data > Column Statistics…", "action": "dataFileShowStatistics:", "hidden": true}, + {"path": "Edit > Data > Search All Columns", "action": "dataFileSearchAllColumns:", "hidden": true}, {"path": "Edit > Data", "separator": true}, - {"path": "Edit > Data > Switch First Row Between Header and Data", "identifier": "shortcut.toggleHeaderRow", "action": "dataFileToggleHeaderRow:", "key": "h", "modifiers": ["shift", "command"]}, - {"path": "Edit > Data > File Properties…", "action": "dataFileShowProperties:"}, - {"path": "Edit > Data > Import into Table…", "action": "dataFileImportIntoTable:"}, + {"path": "Edit > Data > Switch First Row Between Header and Data", "identifier": "shortcut.toggleHeaderRow", "action": "dataFileToggleHeaderRow:", "key": "h", "modifiers": ["shift", "command"], "hidden": true}, + {"path": "Edit > Data > File Properties…", "action": "dataFileShowProperties:", "hidden": true}, + {"path": "Edit > Data > Import into Table…", "action": "dataFileImportIntoTable:", "hidden": true}, {"path": "View"}, {"path": "View > Show Sidebar", "identifier": "shortcut.toggleTableBrowser", "action": "toggleSidebar:", "key": "0", "modifiers": ["command"]}, {"path": "View > Show Inspector", "identifier": "shortcut.toggleInspector", "action": "toggleInspector:", "key": "i", "modifiers": ["option", "command"]}, @@ -347,7 +346,6 @@ "com.TablePro.toolbar.results", "com.TablePro.toolbar.export", "com.TablePro.toolbar.import", - "com.TablePro.toolbar.dashboard", "com.TablePro.toolbar.history", "com.TablePro.toolbar.addRow", "com.TablePro.toolbar.restorePreviousValues", diff --git a/TableProTests/Core/Menu/ChromeSnapshotTests.swift b/TableProTests/Core/Menu/ChromeSnapshotTests.swift index 1da1440d16..f4f91676ff 100644 --- a/TableProTests/Core/Menu/ChromeSnapshotTests.swift +++ b/TableProTests/Core/Menu/ChromeSnapshotTests.swift @@ -94,20 +94,9 @@ private enum ChromeSnapshot { """ } - // MainMenuBuilder.build assigns NSApp's Services, Window and Help menus. The app's own are put - // back so the test host keeps the menu bar it launched with. private static func menuBarEntries() -> [String] { - let app = NSApplication.shared - let services = app.servicesMenu - let windows = app.windowsMenu - let help = app.helpMenu - defer { - app.servicesMenu = services - app.windowsMenu = windows - app.helpMenu = help - } - let menu = MainMenuBuilder.build(keyboard: KeyboardSettings()) - return entries(in: menu, path: [], appKitOwned: app.servicesMenu) + let built = MainMenuBuilder.build(keyboard: KeyboardSettings()) + return entries(in: built.bar, path: [], appKitOwned: built.servicesMenu) } // AppKit fills the Services menu and appends open windows to the Window menu, so neither is