Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhirverma committed Jun 23, 2020
1 parent 96cdb44 commit bff3ff0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/tekton/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Pipeline extends TektonItem {
static async start(pipeline: TektonNode): Promise<string> {
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});
Expand Down
1 change: 1 addition & 0 deletions test/tekton/pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
10 changes: 5 additions & 5 deletions test/tekton/pipelinecontent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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: []
Expand All @@ -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: []
Expand Down

0 comments on commit bff3ff0

Please sign in to comment.