From 188e155b06294d2adc770804ffd078fa6e31f459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Caplette?= Date: Tue, 23 Aug 2022 09:18:16 -0400 Subject: [PATCH] Fix dropdown in CI/CD variables not showing the current type We were using the wrong constants in the new CI/CD variable dropdown which resulted in the currently selected type not to be shown. This commit now make use of the right constant. We are also adding tests. --- .../components/ci_variable_modal.vue | 14 +++++++++----- .../javascripts/ci_variable_list/constants.js | 10 +++++----- .../components/ci_variable_modal_spec.js | 17 +++++++++++++++++ spec/frontend/ci_variable_list/mocks.js | 6 +++--- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue index 5ba63de8c96306..1ae06773ea86b5 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue @@ -108,7 +108,6 @@ export default { return { newEnvironments: [], isTipDismissed: getCookie(AWS_TIP_DISMISSED_COOKIE_NAME) === 'true', - typeOptions: variableOptions, validationErrorEventProperty: '', variable: { ...defaultVariableState, ...this.selectedVariable }, }; @@ -259,6 +258,7 @@ export default { }, }, defaultScope: allEnvironments.text, + variableOptions, }; @@ -298,16 +298,20 @@ export default { /> -
- +
+ - +