fix: refs #8372 front test
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-02-06 13:44:14 +01:00
parent 60d96c8030
commit 16805afc88
1 changed files with 6 additions and 5 deletions

View File

@ -6,6 +6,7 @@ describe('FormModel', () => {
const model = 'mockModel';
const url = 'mockUrl';
const formInitialData = { mockKey: 'mockVal' };
const defaultSaveOpts = { prevent: false };
describe('modelValue', () => {
it('should use the provided model', () => {
@ -87,7 +88,7 @@ describe('FormModel', () => {
it('should not call if there are not changes', async () => {
const { vm } = mount({ propsData: { url, model } });
await vm.save();
await vm.save(defaultSaveOpts);
expect(vm.hasChanges).toBe(false);
});
@ -96,7 +97,7 @@ describe('FormModel', () => {
const { vm } = mount({ propsData: { url, model, formInitialData } });
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save();
await vm.save(defaultSaveOpts);
expect(spy).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
});
@ -108,7 +109,7 @@ describe('FormModel', () => {
});
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save();
await vm.save(defaultSaveOpts);
expect(spy).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
});
@ -122,7 +123,7 @@ describe('FormModel', () => {
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save();
await vm.save(defaultSaveOpts);
expect(spyPatch).not.toHaveBeenCalled();
expect(spySaveFn).toHaveBeenCalled();
vm.formData.mockKey = 'mockVal';
@ -136,7 +137,7 @@ describe('FormModel', () => {
vm.formData.mockKey = 'newVal';
await vm.$nextTick();
await vm.save();
await vm.save(defaultSaveOpts);
vm.formData.mockKey = 'mockVal';
});
});