Skip to content

Commit

Permalink
fix: find in files integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 19, 2024
1 parent 0ae5956 commit b62fb46
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/spec/FindInFiles-integ-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ define(function (require, exports, module) {
}, "indexing complete", 20000);
var $searchField = $("#find-what");
FindInFiles._searchDone = false;
// if the search str is same as previous string, fif will not do any search as its already loaded
$searchField.val("another_str_to_trigger_fif").trigger("input");
await awaitsFor(function () {
return FindInFiles._searchDone;
}, "Find in Files done");
FindInFiles._searchDone = false;
$searchField.val(searchString).trigger("input");
await awaitsFor(function () {
return FindInFiles._searchDone;
Expand Down Expand Up @@ -549,11 +555,17 @@ define(function (require, exports, module) {
expect(Object.keys(FindInFiles.searchModel.results).length).not.toBe(0);

await closeSearchBar();
await openSearchBar(fileEntry);

// Search model shouldn't be cleared from merely reopening search bar
// Search model shouldn't be cleared after search bar closed
expect(Object.keys(FindInFiles.searchModel.results).length).not.toBe(0);

await openSearchBar(fileEntry);
// opening searchbar will also trigger a search with last searched string

await awaitsFor(function () {
return Object.keys(FindInFiles.searchModel.results).length;
}, "waiting for search results to be there");

await closeSearchBar();

// Search model shouldn't be cleared after search bar closed without running a search
Expand Down

0 comments on commit b62fb46

Please sign in to comment.