#7050 testCrudModel #1077

Merged
jtubau merged 11 commits from 7050-testCrudModel into dev 2024-12-26 11:14:16 +00:00
Member
No description provided.
jtubau added 2 commits 2024-12-12 14:58:46 +00:00
jtubau changed title from WIP: 7050-testCrudModel to WIP: #7050 testCrudModel 2024-12-12 15:00:49 +00:00
jtubau added 1 commit 2024-12-12 15:05:49 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
0706c9d58e
fix: refs #7050 delete import added by mistake
jtubau added 1 commit 2024-12-12 15:48:53 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
d601caf95b
Merge branch 'dev' into 7050-testCrudModel
jtubau added 1 commit 2024-12-17 13:48:04 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
48805f977b
Merge branch 'dev' into 7050-testCrudModel
jtubau added 1 commit 2024-12-18 06:07:20 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
9d955f45bb
test: refs #7050 add tests to fns resetData() and saveChanges()
jtubau changed title from WIP: #7050 testCrudModel to #7050 testCrudModel 2024-12-18 06:16:16 +00:00
jtubau requested review from alexm 2024-12-18 06:16:26 +00:00
alexm requested review from jorgep 2024-12-19 12:18:20 +00:00
alexm refused to review 2024-12-19 12:18:21 +00:00
jorgep reviewed 2024-12-19 12:22:18 +00:00
@ -275,2 +273,2 @@
if (obj.length > 0) return false;
if (Array.isArray(obj)) return !obj.length;
return Object.keys(obj).length === 0 ;
Member

return !Object.keys(obj).length;

**return !Object.keys(obj).length;**
jtubau marked this conversation as resolved
jorgep reviewed 2024-12-19 12:24:25 +00:00
@ -120,0 +137,4 @@
expect(result).toBe(true);
});
Member

Falta comprobar si es array vacío o lleno

Falta comprobar si es array vacío o lleno
Author
Member

estaban hechos pero los puse dentro del mismo it para comprobar el objeto, los he separado para mayor claridad.

estaban hechos pero los puse dentro del mismo **it** para comprobar el objeto, los he separado para mayor claridad.
jtubau marked this conversation as resolved
jorgep reviewed 2024-12-19 12:29:02 +00:00
@ -120,0 +187,4 @@
expect(vm.watchChanges).toBeNull();
});
it('should set originalData and formatData with data and generate watchChanges', async () => {
Member

Aquí deberias cambiar un dato o varios de formatData y ver al llamar a la fn reset esta vuelve a tener el valor original.

Aquí deberias cambiar un dato o varios de formatData y ver al llamar a la fn reset esta vuelve a tener el valor original.
Author
Member

formData su valor al inicio del test es un array vacío, por eso al comprobarlo, lo hago contra el argumento que se le pasa a la función, ya que ese es el valor que deben de tener tanto originalData como formData.

formData su valor al inicio del test es un array vacío, por eso al comprobarlo, lo hago contra el argumento que se le pasa a la función, ya que ese es el valor que deben de tener tanto originalData como formData.
jtubau marked this conversation as resolved
jorgep reviewed 2024-12-19 12:31:13 +00:00
@ -120,0 +209,4 @@
age: 42,
}];
it('should call saveFn if exists', async () => {
Member

Porque vuelves a crear una instancia de crudmodel? No puedes usar la que ya tenías? Algo tipo vm.$props.saveFn = ....? o pasarlo mockeado desde el principio...

Porque vuelves a crear una instancia de crudmodel? No puedes usar la que ya tenías? Algo tipo vm.$props.saveFn = ....? o pasarlo mockeado desde el principio...
jtubau marked this conversation as resolved
jorgep reviewed 2024-12-19 12:36:42 +00:00
@ -120,0 +242,4 @@
expect(localVm.vm.hasChanges).toBe(false);
});
it('should not call saveFn if not exists', async () => {
Member

El nombre del test no me acaba de convencer... el test lo veo bien. Algo tipo should use the default url if there's not saveFn. Algo así.

El nombre del test no me acaba de convencer... el test lo veo bien. Algo tipo should use the default url if there's not saveFn. Algo así.
jtubau marked this conversation as resolved
jtubau added 1 commit 2024-12-23 06:15:24 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
5cbff5035b
Merge branch 'dev' into 7050-testCrudModel
jtubau added 1 commit 2024-12-23 14:09:19 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
1cf817be17
refactor: refs #7050 refactorize
jtubau added 1 commit 2024-12-24 11:59:46 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
638bd1dc26
refactor: refs #7050 removed blank spaces
jorgep approved these changes 2024-12-26 11:01:27 +00:00
Dismissed
jtubau added 1 commit 2024-12-26 11:12:42 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
33cf755782
Merge remote-tracking branch 'origin/dev' into 7050-testCrudModel
jtubau dismissed jorgep’s review 2024-12-26 11:12:42 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

jtubau added 1 commit 2024-12-26 11:13:15 +00:00
gitea/salix-front/pipeline/pr-dev This commit looks good Details
c27a7fc206
Merge branch 'dev' into 7050-testCrudModel
jtubau requested review from jorgep 2024-12-26 11:13:41 +00:00
jorgep approved these changes 2024-12-26 11:13:57 +00:00
jtubau merged commit 494b8440d6 into dev 2024-12-26 11:14:16 +00:00
jtubau deleted branch 7050-testCrudModel 2024-12-26 11:14:16 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix-front#1077
No description provided.