Skip to content
代码片段 群组 项目
未验证 提交 a1b6f81b 编辑于 作者: Tomas Bulva's avatar Tomas Bulva 提交者: GitLab
浏览文件

Merge branch 'fix-ci-variable-reset' into 'master'

Reset variable visibility on form reset

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177925



Merged-by: default avatarTomas Bulva <tbulva@gitlab.com>
Approved-by: default avatarTomas Bulva <tbulva@gitlab.com>
Co-authored-by: default avatarAnna Vovchenko <avovchenko@gitlab.com>
无相关合并请求
......@@ -381,6 +381,8 @@ export default {
},
resetForm() {
this.variable = { ...defaultVariableState };
this.visibility = VISIBILITY_VISIBLE;
},
setEnvironmentScope(scope) {
this.variable = { ...this.variable, environmentScope: scope };
......
......@@ -243,6 +243,23 @@ describe('CI Variable Drawer', () => {
expect(findVisibilityRadioGroup().attributes('checked')).toBe(expectedVisibility);
},
);
it('is updated on variable update', async () => {
await createComponent({
props: {
selectedVariable: {
...mockProjectVariableFileType,
masked: true,
hidden: true,
},
},
});
expect(findVisibilityRadioGroup().attributes('checked')).toBe(VISIBILITY_HIDDEN);
await wrapper.setProps({ mutationResponse: { message: 'Success', hasError: false } });
expect(findVisibilityRadioGroup().attributes('checked')).toBe(VISIBILITY_VISIBLE);
});
});
it('is disabled when editing a hidden variable', () => {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册