@@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest";
4
4
5
5
import { MockSchemaType , schema } from "../__example__/index" ;
6
6
import { convertQueryToClause } from "../convertQuerytoClause" ;
7
- import { QueryType } from "../types" ;
7
+ import { QueryType , SchemaType } from "../types" ;
8
8
9
9
describe ( "convertQueryToClause" , ( ) => {
10
10
it ( "should convert a single model query with conditions" , ( ) => {
@@ -27,7 +27,7 @@ describe("convertQueryToClause", () => {
27
27
28
28
expect ( result ) . toEqual ( {
29
29
Composite : {
30
- operator : "And " ,
30
+ operator : "Or " ,
31
31
clauses : [
32
32
{
33
33
Member : {
@@ -81,7 +81,7 @@ describe("convertQueryToClause", () => {
81
81
82
82
expect ( result ) . toEqual ( {
83
83
Composite : {
84
- operator : "And " ,
84
+ operator : "Or " ,
85
85
clauses : [
86
86
{
87
87
Member : {
@@ -110,10 +110,10 @@ describe("convertQueryToClause", () => {
110
110
player : {
111
111
$ : {
112
112
where : {
113
- AND : [
113
+ And : [
114
114
{ score : { $gt : 100 } } ,
115
115
{
116
- OR : [
116
+ Or : [
117
117
{ name : { $eq : "Alice" } } ,
118
118
{ name : { $eq : "Bob" } } ,
119
119
] ,
@@ -125,7 +125,7 @@ describe("convertQueryToClause", () => {
125
125
item : {
126
126
$ : {
127
127
where : {
128
- AND : [ { durability : { $lt : 50 } } ] ,
128
+ And : [ { durability : { $lt : 50 } } ] ,
129
129
} ,
130
130
} ,
131
131
} ,
@@ -134,10 +134,12 @@ describe("convertQueryToClause", () => {
134
134
135
135
const result = convertQueryToClause ( query , schema ) ;
136
136
137
+ console . log ( "result" , result ) ;
138
+
137
139
// Updated expectation to match the actual output
138
140
expect ( result ) . toEqual ( {
139
141
Composite : {
140
- operator : "And " ,
142
+ operator : "Or " ,
141
143
clauses : [
142
144
{
143
145
Member : {
0 commit comments