Commit e94e7bfc authored by Mike Greiling's avatar Mike Greiling

Merge branch '37449-fix-eks-authenticate-button' into 'master'

fix: EKS credentials form doesn't "reset" after error

See merge request gitlab-org/gitlab!21958
parents e7cb8eec 81e65744
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
}; };
</script> </script>
<template> <template>
<form name="service-credentials-form" @submit.prevent="createRole({ roleArn, externalId })"> <form name="service-credentials-form">
<h2>{{ s__('ClusterIntegration|Authenticate with Amazon Web Services') }}</h2> <h2>{{ s__('ClusterIntegration|Authenticate with Amazon Web Services') }}</h2>
<p> <p>
{{ {{
...@@ -136,6 +136,7 @@ export default { ...@@ -136,6 +136,7 @@ export default {
:disabled="submitButtonDisabled" :disabled="submitButtonDisabled"
:loading="isCreatingRole" :loading="isCreatingRole"
:label="submitButtonLabel" :label="submitButtonLabel"
@click.prevent="createRole({ roleArn, externalId })"
/> />
</form> </form>
</template> </template>
---
title: 'fix: EKS credentials form does not reset after error'
merge_request: 21958
author:
type: other
...@@ -47,7 +47,6 @@ describe('ServiceCredentialsForm', () => { ...@@ -47,7 +47,6 @@ describe('ServiceCredentialsForm', () => {
const findCopyExternalIdButton = () => vm.find('.js-copy-external-id-button'); const findCopyExternalIdButton = () => vm.find('.js-copy-external-id-button');
const findInvalidCredentials = () => vm.find('.js-invalid-credentials'); const findInvalidCredentials = () => vm.find('.js-invalid-credentials');
const findSubmitButton = () => vm.find(LoadingButton); const findSubmitButton = () => vm.find(LoadingButton);
const findForm = () => vm.find('form[name="service-credentials-form"]');
it('displays provided account id', () => { it('displays provided account id', () => {
expect(findAccountIdInput().attributes('value')).toBe(accountId); expect(findAccountIdInput().attributes('value')).toBe(accountId);
...@@ -77,8 +76,10 @@ describe('ServiceCredentialsForm', () => { ...@@ -77,8 +76,10 @@ describe('ServiceCredentialsForm', () => {
}); });
}); });
it('dispatches createRole action when form is submitted', () => { it('dispatches createRole action when submit button is clicked', () => {
findForm().trigger('submit'); vm.setData({ roleArn: '123' }); // set role ARN to enable button
findSubmitButton().vm.$emit('click', new Event('click'));
expect(createRoleAction).toHaveBeenCalled(); expect(createRoleAction).toHaveBeenCalled();
}); });
......
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