Commit 6dd2b4b9 authored by Phil Hughes's avatar Phil Hughes

Added spec for window reload

[ci skip]
parent 468afcaa
......@@ -76,18 +76,6 @@ describe('Issuable output', () => {
});
});
it('changes element for `form` when open', (done) => {
vm.showForm = true;
Vue.nextTick(() => {
expect(
vm.$el.tagName,
).toBe('FORM');
done();
});
});
it('does not show actions if permissions are incorrect', (done) => {
vm.showForm = true;
vm.canUpdate = false;
......@@ -121,6 +109,29 @@ describe('Issuable output', () => {
});
});
it('reloads the page if the confidential status has changed', (done) => {
spyOn(window.location, 'reload');
spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve) => {
resolve({
json() {
return {
confidential: true,
};
},
});
}));
vm.updateIssuable();
setTimeout(() => {
expect(
window.location.reload,
).toHaveBeenCalled();
done();
});
});
it('closes form on error', (done) => {
spyOn(window, 'Flash').and.callThrough();
spyOn(vm.service, 'updateIssuable').and.callFake(() => new Promise((resolve, reject) => {
......
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