Commit 575943d8 authored by Phil Hughes's avatar Phil Hughes

Merge branch '236186-clear-requirement-title-on-save' into 'master'

Clear Requirement Title field on drawer close

Closes #236186

See merge request gitlab-org/gitlab!39532
parents 0f28b05b d6a6a54c
...@@ -62,6 +62,12 @@ export default { ...@@ -62,6 +62,12 @@ export default {
}, },
deep: true, deep: true,
}, },
drawerOpen(value) {
// Clear `title` value on drawer close.
if (!value) {
this.title = '';
}
},
}, },
methods: { methods: {
getDrawerHeaderHeight() { getDrawerHeaderHeight() {
......
...@@ -114,6 +114,22 @@ describe('RequirementForm', () => { ...@@ -114,6 +114,22 @@ describe('RequirementForm', () => {
expect(wrapperWithRequirement.vm.title).toBe(''); expect(wrapperWithRequirement.vm.title).toBe('');
}); });
}); });
describe('drawerOpen', () => {
it('clears `title` value when `drawerOpen` prop is changed to false', async () => {
wrapper.setData({
title: 'Foo',
});
wrapper.setProps({
drawerOpen: false,
});
await wrapper.vm.$nextTick();
expect(wrapper.vm.title).toBe('');
});
});
}); });
describe('methods', () => { describe('methods', () => {
......
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