Commit e78b8223 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issue-edit-inline-getdata-after-update' into 'issue-edit-inline'

Get new data after inline edit save

See merge request !11601
parents d853d821 d3198c60
...@@ -124,6 +124,11 @@ export default { ...@@ -124,6 +124,11 @@ export default {
gl.utils.visitUrl(location.pathname); gl.utils.visitUrl(location.pathname);
} }
return this.service.getData();
})
.then(res => res.json())
.then((data) => {
this.store.updateState(data);
eventHub.$emit('close.form'); eventHub.$emit('close.form');
}) })
.catch(() => { .catch(() => {
......
...@@ -109,6 +109,30 @@ describe('Issuable output', () => { ...@@ -109,6 +109,30 @@ describe('Issuable output', () => {
}); });
describe('updateIssuable', () => { describe('updateIssuable', () => {
it('fetches new data after update', (done) => {
spyOn(vm.service, 'getData');
spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => {
resolve({
json() {
return {
confidential: false,
path: location.pathname,
};
},
});
}));
vm.updateIssuable();
setTimeout(() => {
expect(
vm.service.getData,
).toHaveBeenCalled();
done();
});
});
it('reloads the page if the confidential status has changed', (done) => { it('reloads the page if the confidential status has changed', (done) => {
spyOn(gl.utils, 'visitUrl'); spyOn(gl.utils, 'visitUrl');
spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => { spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => {
......
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