#8372 prevent double submit #1333

Merged
alexm merged 29 commits from 8372-fixDoubleRequest into dev 2025-02-13 12:40:17 +00:00
1 changed files with 5 additions and 6 deletions
Showing only changes of commit 115b60751a - Show all commits

View File

@ -6,7 +6,6 @@ describe('FormModel', () => {
const model = 'mockModel';
const url = 'mockUrl';
const formInitialData = { mockKey: 'mockVal' };
const prevent = false;
describe('modelValue', () => {
it('should use the provided model', () => {
@ -88,7 +87,7 @@ describe('FormModel', () => {
it('should not call if there are not changes', async () => {
const { vm } = mount({ propsData: { url, model } });
await vm.save(prevent);
await vm.save();
expect(vm.hasChanges).toBe(false);
jorgep marked this conversation as resolved Outdated
Outdated
Review

Si false es el por defecto, no hace falta pasar false

Si false es el por defecto, no hace falta pasar false
});
@ -97,7 +96,7 @@ describe('FormModel', () => {
const { vm } = mount({ propsData: { url, model } });
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save(prevent);
await vm.save();
expect(spy).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
});
@ -110,7 +109,7 @@ describe('FormModel', () => {
await vm.$nextTick();
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save(prevent);
await vm.save();
expect(spy).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
});
@ -124,7 +123,7 @@ describe('FormModel', () => {
await vm.$nextTick();
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save(prevent);
await vm.save();
expect(spyPatch).not.toHaveBeenCalled();
expect(spySaveFn).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
@ -138,7 +137,7 @@ describe('FormModel', () => {
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save(prevent);
await vm.save();
vm.formData.mockKey = 'mockVal';
});
});