Skip to content

Commit dda3822

Browse files
committed
test(nav): drop the two click-dispatch tests that flaked the suite
Removing the #showInfileTree and #searchNav click-dispatch specs added in fa455de (and then tried to be patched up in 1fdcf51). Even with no openFile and with explicit FindInFilesUI._closeFindBar cleanup, triggering those clicks still leaked side effects across closeTestWindow() + loadProjectInTestWindow() that shifted the subsequent _validateNavForFiles tests' nav-history ordering, producing deterministic "Active file to be test.css" timeouts only in full-suite runs. Commenting the two specs out was confirmed by the user to restore the suite. The dispatch-on-click coverage these provided isn't worth the flake surface; if it's wanted later it should live in a describe block with isolated beforeAll/afterAll so it can't race the history tests.
1 parent 6bf254e commit dda3822

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

test/spec/Extn-NavigationAndHistory-integ-test.js

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -344,52 +344,6 @@ define(function (require, exports, module) {
344344
await _expectNavButton(false, true, "nav forward disabled due to new file open");
345345
}
346346

347-
function recordCommands(fn) {
348-
const executed = [];
349-
const handler = function (event, id) { executed.push(id); };
350-
CommandManager.on(CommandManager.EVENT_BEFORE_EXECUTE_COMMAND, handler);
351-
try {
352-
fn();
353-
} finally {
354-
CommandManager.off(CommandManager.EVENT_BEFORE_EXECUTE_COMMAND, handler);
355-
}
356-
return executed;
357-
}
358-
359-
it("Should dispatch NAVIGATE_SHOW_IN_FILE_TREE when #showInfileTree is clicked", function () {
360-
// Don't open a file here. `recordCommands` hooks EVENT_BEFORE_EXECUTE_COMMAND,
361-
// which fires regardless of whether handleShowInTree's activeFile branch runs.
362-
// Opening a file would leak into the session-restore state and shift the
363-
// nav-history ordering the subsequent _validateNavForFiles tests depend on.
364-
const $btn = $("#showInfileTree");
365-
expect($btn.length).toBe(1);
366-
const executed = recordCommands(function () {
367-
$btn.trigger("click");
368-
});
369-
expect(executed).toContain(Commands.NAVIGATE_SHOW_IN_FILE_TREE);
370-
}, 15000);
371-
372-
it("Should dispatch CMD_FIND_IN_FILES when #searchNav is clicked", async function () {
373-
const $btn = $("#searchNav");
374-
expect($btn.length).toBe(1);
375-
const executed = recordCommands(function () {
376-
$btn.trigger("click");
377-
});
378-
expect(executed).toContain(Commands.CMD_FIND_IN_FILES);
379-
// The click opens the Find-in-Files bar; close it before the
380-
// next test's beforeEach reloads, otherwise the modal bar leaks
381-
// across the reload and subsequent navigation tests fail with
382-
// "Active file to be ... timed out" because the new window's
383-
// focus/key handling is stuck behind the stale bar.
384-
const FindInFilesUI = testWindow.brackets.test.FindInFilesUI;
385-
if (FindInFilesUI && FindInFilesUI._closeFindBar) {
386-
FindInFilesUI._closeFindBar(true);
387-
}
388-
await awaitsFor(function () {
389-
return $(".modal-bar").length === 0;
390-
}, "find bar to close", 2000);
391-
}, 15000);
392-
393347
it("Should navigate back and forward between text files", async function () {
394348
await navigateResetStack();
395349
await _validateNavForFiles("test.css", "test.html", "test.js");

0 commit comments

Comments
 (0)