+
+
-
+
{{ __('Environment scope') }}
{
const findValueField = () => wrapper.find('#ci-variable-value');
const findEnvScopeLink = () => wrapper.findByTestId('environment-scope-link');
const findEnvScopeInput = () => wrapper.findByTestId('environment-scope').find(GlFormInput);
+ const findVariableTypeDropdown = () => wrapper.find('#ci-variable-type');
afterEach(() => {
wrapper.destroy();
@@ -284,6 +286,21 @@ describe('Ci variable modal', () => {
});
});
+ describe('variable type dropdown', () => {
+ describe('default behaviour', () => {
+ beforeEach(() => {
+ createComponent({ mountFn: mountExtended });
+ });
+
+ it('adds each option as a dropdown item', () => {
+ expect(findVariableTypeDropdown().findAll('option')).toHaveLength(variableOptions.length);
+ variableOptions.forEach((v) => {
+ expect(findVariableTypeDropdown().text()).toContain(v.text);
+ });
+ });
+ });
+ });
+
describe('Validations', () => {
const maskError = 'This variable can not be masked.';
diff --git a/spec/frontend/ci_variable_list/mocks.js b/spec/frontend/ci_variable_list/mocks.js
index b030005cb8d830e991cc2c56831473de739ebd37..6d633c8b7400a41af318507afc2f92234fa14f14 100644
--- a/spec/frontend/ci_variable_list/mocks.js
+++ b/spec/frontend/ci_variable_list/mocks.js
@@ -16,8 +16,8 @@ export const mockVariables = (kind) => {
key: 'my-var',
masked: false,
protected: true,
- value: 'env_val',
- variableType: variableTypes.variableType,
+ value: 'variable_value',
+ variableType: variableTypes.envType,
},
{
__typename: `Ci${kind}Variable`,
@@ -25,7 +25,7 @@ export const mockVariables = (kind) => {
key: 'secret',
masked: true,
protected: false,
- value: 'the_secret_value',
+ value: 'another_value',
variableType: variableTypes.fileType,
},
];