Skip to content

Commit 27fe3fd

Browse files
committed
test(terminal): add integration tests for panel close confirmation
Tests cover: single idle terminal closes without dialog, multiple terminals show close-all dialog, active process shows close-terminal dialog, stop-processes dialog variant, cancel preserves state, confirm disposes all terminals, and programmatic hide() keeps terminals alive. Also adds _writeToActiveTerminal test helper to terminal extension.
1 parent 16053f9 commit 27fe3fd

3 files changed

Lines changed: 420 additions & 0 deletions

File tree

src/extensionsIntegrated/Terminal/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,4 +673,19 @@ define(function (require, exports, module) {
673673
// Export for testing
674674
exports.CMD_VIEW_TERMINAL = CMD_VIEW_TERMINAL;
675675
exports.CMD_NEW_TERMINAL = CMD_NEW_TERMINAL;
676+
677+
/**
678+
* Write data to the active terminal's PTY. Test-only helper.
679+
* @param {string} data The text to send to the terminal.
680+
* @return {Promise}
681+
*/
682+
exports._writeToActiveTerminal = function (data) {
683+
const active = _getActiveTerminal();
684+
if (!active || !active.isAlive) {
685+
return Promise.reject(new Error("No active terminal"));
686+
}
687+
return nodeConnector.execPeer("writeTerminal", {
688+
id: active.id, data
689+
});
690+
};
676691
});

test/UnitTestSuite.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ define(function (require, exports, module) {
140140
require("spec/Extn-HTMLCodeHints-Lint-integ-test");
141141
require("spec/Extn-HtmlTagSyncEdit-integ-test");
142142
require("spec/Extn-Git-integ-test");
143+
require("spec/Terminal-integ-test");
143144
// Node Tests
144145
require("spec/NodeConnection-test");
145146
// pro test suite optional components

0 commit comments

Comments
 (0)