test: Add test to validate error when 'in' field in where clause is undefine and contain null values (#17670)

This commit is contained in:
Anik Dhabal Babu
2024-11-15 19:55:34 +00:00
committed by GitHub
parent 7ce5886b4f
commit 9273226fb4
@@ -44,4 +44,18 @@ describe("Disallow undefined delete/update many", () => {
checkUndefinedInValue(where);
});
it("checkUndefinedInValue should throw exception when the where object contain null values and 'in' field is undefined", async () => {
const where = {
teamId: null,
parentId: null,
id: {
in: undefined,
},
};
expect(() => checkUndefinedInValue(where)).toThrowError(
'The "in" value for the field "id" cannot be undefined.'
);
});
});