Skip to content

Commit 1f6652e

Browse files
committed
clean up
1 parent d6dea7b commit 1f6652e

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

src/test/features/terminal/terminalManager.unit.test.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ suite('TerminalManager - create()', () => {
127127
// With ACT_TYPE_COMMAND, create() awaits activation which blocks returning the terminal.
128128
// Without showing the terminal early, users wouldn't see it until activation completes (2-5 seconds).
129129
test('ACT_TYPE_COMMAND: shows terminal before awaiting activation to prevent hidden terminal during activation', async () => {
130-
// Mock
131130
mockGetAutoActivationType.returns(terminalUtils.ACT_TYPE_COMMAND);
132131
terminalManager = createTerminalManager();
133-
134-
// Run
135132
const env = createMockEnvironment();
133+
136134
await terminalManager.create(env, { cwd: '/workspace' });
137135

138-
// Assert - show() must be called before activate() so terminal is visible during activation
139136
const { callOrder } = terminalActivation;
140137
assert.ok(callOrder.includes('show'), 'Terminal show() should be called');
141138
assert.ok(callOrder.includes('activate'), 'Terminal activate() should be called');
@@ -150,45 +147,36 @@ suite('TerminalManager - create()', () => {
150147
// With ACT_TYPE_SHELL/OFF, create() returns immediately without blocking.
151148
// The caller (runInTerminal) handles showing the terminal, so create() shouldn't call show().
152149
test('ACT_TYPE_SHELL: does not call show() since create() returns immediately and caller handles visibility', async () => {
153-
// Mock
154150
mockGetAutoActivationType.returns(terminalUtils.ACT_TYPE_SHELL);
155151
terminalManager = createTerminalManager();
156-
157-
// Run
158152
const env = createMockEnvironment();
153+
159154
await terminalManager.create(env, { cwd: '/workspace' });
160155

161-
// Assert - no blocking activation means caller (runInTerminal) will show terminal
162156
const { callOrder } = terminalActivation;
163157
assert.strictEqual(callOrder.includes('show'), false, 'show() deferred to caller');
164158
assert.strictEqual(callOrder.includes('activate'), false, 'No command activation for shell startup mode');
165159
});
166160

167161
test('ACT_TYPE_OFF: does not call show() since create() returns immediately and caller handles visibility', async () => {
168-
// Mock
169162
mockGetAutoActivationType.returns(terminalUtils.ACT_TYPE_OFF);
170163
terminalManager = createTerminalManager();
171-
172-
// Run
173164
const env = createMockEnvironment();
165+
174166
await terminalManager.create(env, { cwd: '/workspace' });
175167

176-
// Assert - no activation means caller (runInTerminal) will show terminal
177168
const { callOrder } = terminalActivation;
178169
assert.strictEqual(callOrder.includes('show'), false, 'show() deferred to caller');
179170
assert.strictEqual(callOrder.includes('activate'), false, 'Activation disabled');
180171
});
181172

182173
test('disableActivation option: skips both show() and activation, returns terminal immediately', async () => {
183-
// Mock
184174
mockGetAutoActivationType.returns(terminalUtils.ACT_TYPE_COMMAND);
185175
terminalManager = createTerminalManager();
186-
187-
// Run
188176
const env = createMockEnvironment();
177+
189178
const terminal = await terminalManager.create(env, { cwd: '/workspace', disableActivation: true });
190179

191-
// Assert - terminal returned without any activation logic
192180
const { callOrder } = terminalActivation;
193181
assert.ok(terminal, 'Terminal should be returned');
194182
assert.strictEqual(callOrder.includes('show'), false, 'No show() when activation skipped');

0 commit comments

Comments
 (0)