summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/ideCommand.test.ts
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-08-08 17:26:11 -0400
committerGitHub <[email protected]>2025-08-08 21:26:11 +0000
commit344ee29f7713b6a249e510674c7410d0fb8ec2f8 (patch)
treef3fecb7d55696f36e0768869d3bf46fc4aee5a80 /packages/cli/src/ui/commands/ideCommand.test.ts
parent60bde58f29815edba365daf04c07080e8d1b24d8 (diff)
Use slash command instead of context drawer to display open files in editor to reduce flickering in the UI (#5858)
Diffstat (limited to 'packages/cli/src/ui/commands/ideCommand.test.ts')
-rw-r--r--packages/cli/src/ui/commands/ideCommand.test.ts28
1 files changed, 16 insertions, 12 deletions
diff --git a/packages/cli/src/ui/commands/ideCommand.test.ts b/packages/cli/src/ui/commands/ideCommand.test.ts
index 9898b1e8..10a97e2a 100644
--- a/packages/cli/src/ui/commands/ideCommand.test.ts
+++ b/packages/cli/src/ui/commands/ideCommand.test.ts
@@ -93,13 +93,14 @@ describe('ideCommand', () => {
} as unknown as ReturnType<Config['getIdeClient']>);
});
- it('should show connected status', () => {
+ it('should show connected status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Connected,
});
const command = ideCommand(mockConfig);
- const result = command!.subCommands!.find((c) => c.name === 'status')!
- .action!(mockContext, '');
+ const result = await command!.subCommands!.find(
+ (c) => c.name === 'status',
+ )!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@@ -108,13 +109,14 @@ describe('ideCommand', () => {
});
});
- it('should show connecting status', () => {
+ it('should show connecting status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Connecting,
});
const command = ideCommand(mockConfig);
- const result = command!.subCommands!.find((c) => c.name === 'status')!
- .action!(mockContext, '');
+ const result = await command!.subCommands!.find(
+ (c) => c.name === 'status',
+ )!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@@ -122,13 +124,14 @@ describe('ideCommand', () => {
content: `🟡 Connecting...`,
});
});
- it('should show disconnected status', () => {
+ it('should show disconnected status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Disconnected,
});
const command = ideCommand(mockConfig);
- const result = command!.subCommands!.find((c) => c.name === 'status')!
- .action!(mockContext, '');
+ const result = await command!.subCommands!.find(
+ (c) => c.name === 'status',
+ )!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@@ -137,15 +140,16 @@ describe('ideCommand', () => {
});
});
- it('should show disconnected status with details', () => {
+ it('should show disconnected status with details', async () => {
const details = 'Something went wrong';
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Disconnected,
details,
});
const command = ideCommand(mockConfig);
- const result = command!.subCommands!.find((c) => c.name === 'status')!
- .action!(mockContext, '');
+ const result = await command!.subCommands!.find(
+ (c) => c.name === 'status',
+ )!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',