Skip to content

Commit 7d8aecc

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

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/document/DocumentCommandHandlers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,6 +2148,12 @@ define(function (require, exports, module) {
21482148
_$dirtydot = $(".dirty-dot", _$titleWrapper);
21492149
});
21502150

2151+
if(Phoenix.isSpecRunnerWindow){
2152+
_$titleContainerToolbar = $("#titlebar");
2153+
_$titleWrapper = $(".title-wrapper");
2154+
_$title = $(".title");
2155+
_$dirtydot = $(".dirty-dot");
2156+
}
21512157

21522158
let firstProjectOpenHandled = false;
21532159
ProjectManager.on(ProjectManager.EVENT_AFTER_PROJECT_OPEN, ()=>{

src/extensions/default/UrlCodeHints/unittests.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ define(function (require, exports, module) {
270270
CodeHintManager,
271271
CommandManager,
272272
Commands,
273-
DocumentManager,
274-
MainViewManager,
275273
EditorManager;
276274

277275
it("should hint site root '/'", async function () {
@@ -280,24 +278,13 @@ define(function (require, exports, module) {
280278
CodeHintManager = brackets.test.CodeHintManager;
281279
CommandManager = brackets.test.CommandManager;
282280
Commands = brackets.test.Commands;
283-
DocumentManager = brackets.test.DocumentManager;
284281
EditorManager = brackets.test.EditorManager;
285-
MainViewManager = brackets.test.MainViewManager;
286282

287283
await SpecRunnerUtils.loadProjectInTestWindow(extensionTestPath);
288284

289285
workingSet.push(testHtmlPath);
290286
await awaitsForDone(SpecRunnerUtils.openProjectFiles(workingSet), "openProjectFiles");
291287

292-
DocumentManager.getDocumentForPath(testHtmlPath).done(function (doc) {
293-
testDocument = doc;
294-
});
295-
296-
await awaitsFor(function () {
297-
return (testDocument);
298-
}, "Unable to open test document");
299-
300-
MainViewManager._edit(MainViewManager.ACTIVE_PANE, testDocument);
301288
testEditor = EditorManager.getCurrentFullEditor();
302289
testEditor.setCursorPos({ line: 22, ch: 12 });
303290

@@ -321,9 +308,7 @@ define(function (require, exports, module) {
321308
CodeHintManager = null;
322309
CommandManager = null;
323310
Commands = null;
324-
DocumentManager = null;
325311
EditorManager = null;
326-
MainViewManager = null;
327312
await SpecRunnerUtils.closeTestWindow();
328313
}, 30000);
329314
});

0 commit comments

Comments
 (0)