Skip to content

Commit 1cab4a0

Browse files
committed
fix: url code hinting flakey tests that fail only in actions
1 parent 7d8aecc commit 1cab4a0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/extensions/default/UrlCodeHints/unittests.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,26 +266,27 @@ define(function (require, exports, module) {
266266

267267
var testWindow,
268268
brackets,
269-
workingSet = [],
270269
CodeHintManager,
271270
CommandManager,
272271
Commands,
272+
FileViewController,
273273
EditorManager;
274274

275275
it("should hint site root '/'", async function () {
276276
testWindow = await SpecRunnerUtils.createTestWindowAndRun();
277277
brackets = testWindow.brackets;
278278
CodeHintManager = brackets.test.CodeHintManager;
279279
CommandManager = brackets.test.CommandManager;
280+
FileViewController = brackets.test.FileViewController;
280281
Commands = brackets.test.Commands;
281282
EditorManager = brackets.test.EditorManager;
282283

283284
await SpecRunnerUtils.loadProjectInTestWindow(extensionTestPath);
284285

285-
workingSet.push(testHtmlPath);
286-
await awaitsForDone(SpecRunnerUtils.openProjectFiles(workingSet), "openProjectFiles");
286+
await awaitsForDone(
287+
FileViewController.openAndSelectDocument(testHtmlPath, FileViewController.WORKING_SET_VIEW));
287288

288-
testEditor = EditorManager.getCurrentFullEditor();
289+
testEditor = EditorManager.getActiveEditor();
289290
testEditor.setCursorPos({ line: 22, ch: 12 });
290291

291292
let hintList;
@@ -306,6 +307,7 @@ define(function (require, exports, module) {
306307
testWindow = null;
307308
brackets = null;
308309
CodeHintManager = null;
310+
FileViewController = null;
309311
CommandManager = null;
310312
Commands = null;
311313
EditorManager = null;

0 commit comments

Comments
 (0)