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:
Filipa Lacerda 2017-05-24 09:42:31 +00:00
commit e78b8223fe
2 changed files with 29 additions and 0 deletions

View File

@ -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(() => {

View File

@ -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) => {