summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/themeCommand.test.ts
diff options
context:
space:
mode:
authorharoldmciver-go <[email protected]>2025-07-11 16:01:28 -0400
committerGitHub <[email protected]>2025-07-11 20:01:28 +0000
commit4197f3027857f1f6e83aedacb7e47a07690e2095 (patch)
treed2d568850fb8dce11e383f8252fe59330791ff7d /packages/cli/src/ui/commands/themeCommand.test.ts
parent2826c7a1c60bc09d256d7a7c11bdd98f65316cb7 (diff)
update /theme to new slash command arch (#3791)
Co-authored-by: matt korwel <[email protected]> Co-authored-by: Abhi <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/commands/themeCommand.test.ts')
-rw-r--r--packages/cli/src/ui/commands/themeCommand.test.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/cli/src/ui/commands/themeCommand.test.ts b/packages/cli/src/ui/commands/themeCommand.test.ts
new file mode 100644
index 00000000..2a537bcc
--- /dev/null
+++ b/packages/cli/src/ui/commands/themeCommand.test.ts
@@ -0,0 +1,38 @@
+/**
+ * @license
+ * Copyright 2025 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import { describe, it, expect, beforeEach } from 'vitest';
+import { themeCommand } from './themeCommand.js';
+import { type CommandContext } from './types.js';
+import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
+
+describe('themeCommand', () => {
+ let mockContext: CommandContext;
+
+ beforeEach(() => {
+ mockContext = createMockCommandContext();
+ });
+
+ it('should return a dialog action to open the theme dialog', () => {
+ // Ensure the command has an action to test.
+ if (!themeCommand.action) {
+ throw new Error('The theme command must have an action.');
+ }
+
+ const result = themeCommand.action(mockContext, '');
+
+ // Assert that the action returns the correct object to trigger the theme dialog.
+ expect(result).toEqual({
+ type: 'dialog',
+ dialog: 'theme',
+ });
+ });
+
+ it('should have the correct name and description', () => {
+ expect(themeCommand.name).toBe('theme');
+ expect(themeCommand.description).toBe('change the theme');
+ });
+});