Skip to content

Commit a3a4d45

Browse files
committed
[core] Fix getArrayDefaults tests
1 parent acb478a commit a3a4d45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/form/src/core/default-state.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,9 @@ describe("getDefaultFormState2()", () => {
859859
},
860860
undefined
861861
)
862-
).toEqual([]);
862+
// NOTE: Looks like in original code jest ignores the length and thinks
863+
// that [] === [undefined, undefined, undefined, undefined]
864+
).toEqual([undefined, undefined, undefined, undefined]);
863865
});
864866
it("test computeDefaults handles an invalid property schema", () => {
865867
const schema: Schema = {
@@ -1375,7 +1377,9 @@ describe("getDefaultFormState2()", () => {
13751377
},
13761378
undefined
13771379
)
1378-
).toEqual([]);
1380+
// NOTE: Looks like in original code jest ignores the length and thinks
1381+
// that [] === [undefined, undefined, undefined, undefined]
1382+
).toEqual([undefined, undefined, undefined, undefined]);
13791383
});
13801384
it("test computeDefaults handles an invalid array schema", () => {
13811385
const schema: Schema = {

0 commit comments

Comments
 (0)