fix: refs #8372 update save method calls in FormModel tests to use prevent option directly
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-02-07 17:18:57 +01:00
parent e1605e0610
commit 9a946c0f39
2 changed files with 7 additions and 7 deletions

View File

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

View File

@ -20,7 +20,7 @@ describe('InvoiceInBasicData', () => {
cy.get(formInputs).eq(1).invoke('val').should('eq', '4739');
});
it.only('should edit, remove and create the dms data', () => {
it('should edit, remove and create the dms data', () => {
const firtsInput = 'Ticket:65';
const secondInput = "I don't know what posting here!";