Fix tests

This commit is contained in:
Adria Navarro 2024-10-11 13:13:34 +02:00
parent f73b7d4824
commit ca7a7bcef9
1 changed files with 21 additions and 24 deletions

View File

@ -2511,31 +2511,28 @@ describe.each([
} }
) )
it.each([logicalOperators])( it("should allow nested ors with multiple conditions", async () => {
"should allow nested ors with multiple conditions (with %s as root)", await expectQuery({
async rootOperator => { $or: {
await expectQuery({ conditions: [
[rootOperator]: { {
conditions: [ $or: {
{ conditions: [
$or: { {
conditions: [ equal: { ["productCat.name"]: "foo" },
{ },
equal: { ["productCat.name"]: "foo" }, ],
},
],
},
notEqual: { ["productCat.name"]: "foo" },
}, },
], notEqual: { ["productCat.name"]: "foo" },
}, },
}).toContainExactly([ ],
{ name: "foo", productCat: [{ _id: productCatRows[0]._id }] }, },
{ name: "bar", productCat: [{ _id: productCatRows[1]._id }] }, }).toContainExactly([
// { name: "baz", productCat: undefined }, // TODO { name: "foo", productCat: [{ _id: productCatRows[0]._id }] },
]) { name: "bar", productCat: [{ _id: productCatRows[1]._id }] },
} // { name: "baz", productCat: undefined }, // TODO
) ])
})
}) })
}) })
}) })