Merge pull request #6660 from mabashian/6606-jt-launch

Pass empty params to launch endpoint rather than null

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-04-08 23:46:48 +00:00 committed by GitHub
commit 907da2ae61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class LaunchButton extends React.Component {
const { data: launchConfig } = await readLaunch;
if (canLaunchWithoutPrompt(launchConfig)) {
this.launchWithParams(null);
this.launchWithParams({});
} else {
this.setState({
showLaunchPrompt: true,

View File

@ -62,7 +62,7 @@ describe('LaunchButton', () => {
button.prop('onClick')();
expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1);
await sleep(0);
expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1, null);
expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1, {});
expect(history.location.pathname).toEqual('/jobs/9000/output');
});
@ -99,7 +99,7 @@ describe('LaunchButton', () => {
button.prop('onClick')();
expect(WorkflowJobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1);
await sleep(0);
expect(WorkflowJobTemplatesAPI.launch).toHaveBeenCalledWith(1, null);
expect(WorkflowJobTemplatesAPI.launch).toHaveBeenCalledWith(1, {});
expect(history.location.pathname).toEqual('/jobs/workflow/9000/output');
});