From bff3ff0b80669eac8f199d527a1ab171a8f37a15 Mon Sep 17 00:00:00 2001 From: Sudhir Verma Date: Tue, 23 Jun 2020 08:07:33 +0530 Subject: [PATCH] Fix test --- src/tekton/pipeline.ts | 2 +- test/tekton/pipeline.test.ts | 1 + test/tekton/pipelinecontent.test.ts | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/tekton/pipeline.ts b/src/tekton/pipeline.ts index cd64026e..d83be242 100644 --- a/src/tekton/pipeline.ts +++ b/src/tekton/pipeline.ts @@ -26,7 +26,7 @@ export class Pipeline extends TektonItem { static async start(pipeline: TektonNode): Promise { if (Pipeline.checkWebViewStartPipeline()) { pipelineViewLoader.loadView('Start Pipeline', await pipelineData(pipeline.getName())); - return; + return null; } if (!pipeline) { pipeline = await window.showQuickPick(await Pipeline.getPipelineNames(), {placeHolder: 'Select Pipeline to start', ignoreFocusOut: true}); diff --git a/test/tekton/pipeline.test.ts b/test/tekton/pipeline.test.ts index 17bae382..540d50c6 100644 --- a/test/tekton/pipeline.test.ts +++ b/test/tekton/pipeline.test.ts @@ -34,6 +34,7 @@ suite('Tekton/Pipeline', () => { setup(() => { execStub = sandbox.stub(TknImpl.prototype, 'execute').resolves({ error: null, stdout: '', stderr: '' }); + sandbox.stub(Pipeline, 'checkWebViewStartPipeline').returns(false); showQuickPickStub = sandbox.stub(vscode.window, 'showQuickPick').resolves(undefined); sandbox.stub(TknImpl.prototype, 'getPipelines').resolves([pipelineItem]); getPipelineStub = sandbox.stub(TektonItem, 'getPipelineNames').resolves([pipelineItem]); diff --git a/test/tekton/pipelinecontent.test.ts b/test/tekton/pipelinecontent.test.ts index fe813df1..1c1e3c71 100644 --- a/test/tekton/pipelinecontent.test.ts +++ b/test/tekton/pipelinecontent.test.ts @@ -131,7 +131,7 @@ suite('PipelineContent', () => { const result = await PipelineContent.startObject(pipelineTrigger, 'pipeline'); expect(result).deep.equals({ name: 'build-and-deploy', - params: [ + parameters: [ { default: undefined, description: 'name of the deployment to be patched', @@ -164,7 +164,7 @@ suite('PipelineContent', () => { const result = await PipelineContent.startObject(pipelineTrigger, 'pipeline'); expect(result).deep.equals({ name: 'build-and-deploy', - params: [ + parameters: [ { default: { label: 'params-data' @@ -240,7 +240,7 @@ suite('PipelineContent', () => { const result = await PipelineContent.startObject(workspace, 'pipeline'); expect(result).deep.equals({ name: 'fetch-and-print-recipe', - params: [], + parameters: [], resources: [], serviceAccount: undefined, workspaces: [ @@ -282,7 +282,7 @@ suite('PipelineContent', () => { const result = await PipelineContent.startObject(serviceTrigger, 'pipeline'); expect(result).deep.equals({ name: 'build-and-deploy', - params: [], + parameters: [], resources: [], serviceAccount: 'service', workspaces: [] @@ -295,7 +295,7 @@ suite('PipelineContent', () => { const result = await PipelineContent.startObject(serviceTrigger, 'pipeline'); expect(result).deep.equals({ name: 'build-and-deploy', - params: [], + parameters: [], resources: [], serviceAccount: 'service', workspaces: []