8627-devToTest #1421

Merged
alexm merged 768 commits from 8627-devToTest into test 2025-02-18 12:37:37 +00:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit 16805afc88 - Show all commits

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';
});
});