Skip to content
Snippets Groups Projects
Commit d3198c60 authored by Phil Hughes's avatar Phil Hughes
Browse files

Get new data after inline edit save

[ci skip]
parent 3f996024
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -111,6 +111,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(() => {
Loading
Loading
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment