Skip to content

Commit 2ee9584

Browse files
committed
fix(test): fix codehints test using HTML file for reliable hints
The codehints visibility test used test.js which only contains a comment, so no code hints were available at position (0,0). Changed to test.html with cursor at (8,1) inside a tag name where HTML hints reliably appear. Also removed debug logging and added focus assertion to custom handler test.
1 parent fac5268 commit 2ee9584

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/spec/MainViewManager-integ-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,10 +1013,11 @@ define(function (require, exports, module) {
10131013
expect(panel1.isVisible()).toBeTrue();
10141014

10151015
expect(MainViewManager.getActivePaneId()).toEqual("first-pane");
1016-
promise = MainViewManager._open(MainViewManager.FIRST_PANE, FileSystem.getFileForPath(testPath + "/test.js"));
1016+
promise = MainViewManager._open(MainViewManager.FIRST_PANE, FileSystem.getFileForPath(testPath + "/test.html"));
10171017
await awaitsForDone(promise, "MainViewManager.doOpen");
10181018
let editor = EditorManager.getActiveEditor();
1019-
editor.setCursorPos(0, 0);
1019+
// Position cursor inside the <p tag name to trigger HTML tag hints
1020+
editor.setCursorPos(8, 1);
10201021
await awaitsForDone(CommandManager.execute(Commands.SHOW_CODE_HINTS));
10211022
await awaitsFor(function () {
10221023
return testWindow.$(".codehint-menu").is(":visible");
@@ -1146,6 +1147,7 @@ define(function (require, exports, module) {
11461147
SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown",
11471148
_$("#editor-holder")[0], { shiftKey: true });
11481149
expect(EditorManager.getFocusedEditor()).toBeTruthy();
1150+
expect(testWindow.document.activeElement).not.toBe(_$("#focus-test-input")[0]);
11491151

11501152
focusPanel.hide();
11511153
WorkspaceManager.destroyBottomPanel("focusTestPanel");

0 commit comments

Comments
 (0)