Skip to content

Commit 48b85b2

Browse files
committed
fix: integ tests failing in firefox
1 parent 344dfad commit 48b85b2

File tree

1 file changed

+6
-1
lines changed
  • src/extensionsIntegrated/TabBar

1 file changed

+6
-1
lines changed

src/extensionsIntegrated/TabBar/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-invalid-this */
22
define(function (require, exports, module) {
3+
const _ = require("thirdparty/lodash");
34
const AppInit = require("utils/AppInit");
45
const MainViewManager = require("view/MainViewManager");
56
const EditorManager = require("editor/EditorManager");
@@ -473,7 +474,11 @@ define(function (require, exports, module) {
473474

474475
// For editor changes, update only the tabs.
475476
EditorManager.off("activeEditorChange", updateTabs);
476-
EditorManager.on("activeEditorChange", updateTabs);
477+
// debounce is used to prevent rapid consecutive calls to updateTabs,
478+
// which was causing integration tests to fail in Firefox. Without it,
479+
// the event fires too frequently when switching editors, leading to unexpected behavior
480+
const debounceUpdateTabs = _.debounce(updateTabs, 2);
481+
EditorManager.on("activeEditorChange", debounceUpdateTabs);
477482

478483
// For working set changes, update only the tabs.
479484
const events = [

0 commit comments

Comments
 (0)