Merge branch 'issue-edit-inline-getdata-after-update' into 'issue-edit-inline'
Get new data after inline edit save See merge request !11601
This commit is contained in:
commit
e78b8223fe
|
@ -124,6 +124,11 @@ export default {
|
|||
gl.utils.visitUrl(location.pathname);
|
||||
}
|
||||
|
||||
return this.service.getData();
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then((data) => {
|
||||
this.store.updateState(data);
|
||||
eventHub.$emit('close.form');
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -109,6 +109,30 @@ describe('Issuable output', () => {
|
|||
});
|
||||
|
||||
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) => {
|
||||
spyOn(gl.utils, 'visitUrl');
|
||||
spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => {
|
||||
|
|
Loading…
Reference in New Issue