Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 2a11d47

Browse files
committed
Fix unit test that broke due to a side fix in PR #10413, and enhance tests
to verify that search tickmarks are rendered. Also, bump up wait time in WorkingSetView-test that was failing sporadically. The test had zero margin for error on the wait, which may be making it fragile.
1 parent 7faa51a commit 2a11d47

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

test/spec/FindReplace-test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ define(function (require, exports, module) {
352352
});
353353
}
354354

355+
// Verify number of tickmarks equals number of highlights
356+
var tickmarks = tw$(".tickmark-track .tickmark", myEditor.getRootElement());
357+
expect(tickmarks.length).toEqual(selections.length);
358+
355359
// Verify that editor UI doesn't have extra ranges left highlighted from earlier
356360
// (note: this only works for text that's short enough to not get virtualized)
357361
var lineDiv = tw$(".CodeMirror-lines .CodeMirror-code", myEditor.getRootElement());
@@ -504,7 +508,8 @@ define(function (require, exports, module) {
504508
enterSearchText("b");
505509

506510
expectMatchIndex(0, 2430);
507-
expectHighlightedMatches([]);
511+
// When exceeding 2000 matches, tickmarks disabled and only the *current* editor highlight is shown
512+
expectHighlightedMatches([], 1);
508513
});
509514

510515
it("should find all case-insensitive matches with lowercase text", function () {

test/spec/WorkingSetView-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ define(function (require, exports, module) {
269269
CommandManager.execute(Commands.FILE_RENAME);
270270
});
271271

272-
waits(ProjectManager._RENDER_DEBOUNCE_TIME);
272+
waits(ProjectManager._RENDER_DEBOUNCE_TIME + 50);
273273

274274
runs(function () {
275275
expect($("#project-files-container ul input").val()).toBe(fileName);

0 commit comments

Comments
 (0)