mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-04 06:01:15 -07:00
3eebb75b7a
Co-authored-by: mkorwel <matt.korwel@gmail.com>
37 lines
940 B
TypeScript
37 lines
940 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { describe, it, expect, vi } from 'vitest';
|
|
import { tasksCommand } from './tasksCommand.js';
|
|
import type { CommandContext } from './types.js';
|
|
|
|
describe('tasksCommand', () => {
|
|
it('should call toggleBackgroundTasks', async () => {
|
|
const toggleBackgroundTasks = vi.fn();
|
|
const context = {
|
|
ui: {
|
|
toggleBackgroundTasks,
|
|
},
|
|
} as unknown as CommandContext;
|
|
|
|
if (tasksCommand.action) {
|
|
await tasksCommand.action(context, '');
|
|
}
|
|
|
|
expect(toggleBackgroundTasks).toHaveBeenCalled();
|
|
});
|
|
|
|
it('should have correct name and altNames', () => {
|
|
expect(tasksCommand.name).toBe('tasks');
|
|
expect(tasksCommand.altNames).toContain('bg');
|
|
expect(tasksCommand.altNames).toContain('background');
|
|
});
|
|
|
|
it('should auto-execute', () => {
|
|
expect(tasksCommand.autoExecute).toBe(true);
|
|
});
|
|
});
|