Path: blob/main/test/smoke/src/areas/task/task-quick-pick.test.ts
3520 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Application, Task, Terminal, TerminalCommandId } from '../../../../automation/';67export function setup(options?: { skipSuite: boolean }) {8describe('Task Quick Pick', () => {9let app: Application;10let task: Task;11let terminal: Terminal;1213// Acquire automation API14before(async function () {15app = this.app as Application;16task = app.workbench.task;17terminal = app.workbench.terminal;18});1920afterEach(async () => {21// Kill all terminals between every test for a consistent testing environment22await terminal.runCommand(TerminalCommandId.KillAll);23});2425describe('Tasks: Run Task', () => {26const label = "name";27const type = "shell";28const command = "echo 'test'";29it('hide property - true', async () => {30await task.configureTask({ type, command, label, hide: true });31await task.assertTasks(label, [], 'run');32});33it('hide property - false', async () => {34await task.configureTask({ type, command, label, hide: false });35await task.assertTasks(label, [{ label, hide: false }], 'run');36});37it('hide property - undefined', async () => {38await task.configureTask({ type, command, label });39await task.assertTasks(label, [{ label }], 'run');40});41(options?.skipSuite ? it.skip : it.skip)('icon - icon only', async () => {42const config = { label, type, command, icon: { id: "lightbulb" } };43await task.configureTask(config);44await task.assertTasks(label, [config], 'run');45});46(options?.skipSuite ? it.skip : it.skip)('icon - color only', async () => {47const config = { label, type, command, icon: { color: "terminal.ansiRed" } };48await task.configureTask(config);49await task.assertTasks(label, [{ label, type, command, icon: { color: "Red" } }], 'run');50});51(options?.skipSuite ? it.skip : it.skip)('icon - icon & color', async () => {52const config = { label, type, command, icon: { id: "lightbulb", color: "terminal.ansiRed" } };53await task.configureTask(config);54await task.assertTasks(label, [{ label, type, command, icon: { id: "lightbulb", color: "Red" } }], 'run');55});56});57//TODO: why won't this command run58describe.skip('Tasks: Configure Task', () => {59const label = "name";60const type = "shell";61const command = "echo 'test'";62describe('hide', () => {63it('true should still show the task', async () => {64await task.configureTask({ type, command, label, hide: true });65await task.assertTasks(label, [{ label }], 'configure');66});67});68});69});70}717273