Unverified Commit 390656b4 authored by torgiren's avatar torgiren
Browse files

fix: fix setting git repo for nginx - closes #521

Signed-off-by: torgiren's avatarMarcin Fabrykowski <git@fabrykowski.pl>
1 merge request!60fix: fix setting git repo for nginx - closes #521
Pipeline #3438 passed with stages
in 5 minutes and 6 seconds
Showing with 14 additions and 0 deletions
+14 -0
......@@ -28,6 +28,9 @@ function AppNginxAdd (props) {
}
}
if (input.gitrepo) {
if (!values.spec.config.git) {
values.spec.config.git = {}
}
values.spec.config.git.repo = input.gitrepo
if (input.gitbranch) {
values.spec.config.git.branch = input.gitbranch
......
......@@ -84,4 +84,15 @@ describe('AppNginxAdd', () => {
fireEvent.click(screen.getByText('Create'))
await waitFor(() => expect(screen.getByTestId('nginx-add-message')).toHaveTextContent('no field name'))
})
test('submit nginx app with git', async () => {
window.API_URL = 'http://localhost:8080'
render(<AppNginxAdd org="qwe" onAddElement={() => {}}/>)
expect(screen.getByTestId('nginx-add-org')).toHaveDisplayValue('qwe')
fireEvent.change(screen.getByTestId('nginx-add-name'), { target: { value: 'test-aa' } })
fireEvent.change(screen.getByTestId('nginx-add-git-repo'), { target: { value: 'https://github.com/user/repo' } })
fireEvent.change(screen.getByTestId('nginx-add-git-branch'), { target: { value: 'master' } })
fireEvent.click(screen.getByText('Create'))
await waitFor(() => expect(screen.getByTestId('nginx-add-message')).toHaveTextContent('added'))
})
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment