diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-14 21:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-14 21:08:42 +0300 |
commit | 870dfaa9127e114a6ea2066220760815063fb3de (patch) | |
tree | 687cdcdc75e56796a8711511d9d0e4a56ff4822f /spec/frontend/terraform | |
parent | 8c4225a66b12683bcf1bba9bb9328fcf65395b6d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/terraform')
-rw-r--r-- | spec/frontend/terraform/components/init_command_modal_spec.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/spec/frontend/terraform/components/init_command_modal_spec.js b/spec/frontend/terraform/components/init_command_modal_spec.js index dbdff899bac..911bb8878da 100644 --- a/spec/frontend/terraform/components/init_command_modal_spec.js +++ b/spec/frontend/terraform/components/init_command_modal_spec.js @@ -7,12 +7,13 @@ const accessTokensPath = '/path/to/access-tokens-page'; const terraformApiUrl = 'https://gitlab.com/api/v4/projects/1'; const username = 'username'; const modalId = 'fake-modal-id'; -const stateName = 'production'; +const stateName = 'aws/eu-central-1'; +const stateNameEncoded = encodeURIComponent(stateName); const modalInfoCopyStr = `export GITLAB_ACCESS_TOKEN=<YOUR-ACCESS-TOKEN> terraform init \\ - -backend-config="address=${terraformApiUrl}/${stateName}" \\ - -backend-config="lock_address=${terraformApiUrl}/${stateName}/lock" \\ - -backend-config="unlock_address=${terraformApiUrl}/${stateName}/lock" \\ + -backend-config="address=${terraformApiUrl}/${stateNameEncoded}" \\ + -backend-config="lock_address=${terraformApiUrl}/${stateNameEncoded}/lock" \\ + -backend-config="unlock_address=${terraformApiUrl}/${stateNameEncoded}/lock" \\ -backend-config="username=${username}" \\ -backend-config="password=$GITLAB_ACCESS_TOKEN" \\ -backend-config="lock_method=POST" \\ @@ -61,9 +62,15 @@ describe('InitCommandModal', () => { expect(findLink().attributes('href')).toBe(accessTokensPath); }); - it('renders the init command with the username and state name prepopulated', () => { - expect(findInitCommand().text()).toContain(username); - expect(findInitCommand().text()).toContain(stateName); + describe('init command', () => { + it('includes correct address', () => { + expect(findInitCommand().text()).toContain( + `-backend-config="address=${terraformApiUrl}/${stateNameEncoded}"`, + ); + }); + it('includes correct username', () => { + expect(findInitCommand().text()).toContain(`-backend-config="username=${username}"`); + }); }); it('renders the copyToClipboard button', () => { |