From 2a9ed95cd98a5699cc9168e66fd9b3f8a2798730 Mon Sep 17 00:00:00 2001 From: ryjiang Date: Fri, 27 Dec 2024 10:56:38 +0800 Subject: [PATCH 1/2] Add more test cases for upsert api Signed-off-by: ryjiang --- test/grpc/Upsert.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/grpc/Upsert.spec.ts b/test/grpc/Upsert.spec.ts index fa37dfc5..7b790281 100644 --- a/test/grpc/Upsert.spec.ts +++ b/test/grpc/Upsert.spec.ts @@ -208,6 +208,8 @@ describe(`Upsert API`, () => { const vectorsData = query.data.map((item: any) => { item.bool = true; item.dynamic_upserted_int32 = 100; + item.$meta.dynamic_varChar = 'test'; + item.dynamic_JSON = { a: 1 }; return item; }); @@ -235,6 +237,12 @@ describe(`Upsert API`, () => { (item: any) => item.$meta.dynamic_upserted_int32 === 100 ) ).toBeTruthy(); + expect( + query2.data.every((item: any) => item.$meta.dynamic_varChar === 'test') + ).toBeTruthy(); + expect( + query2.data.every((item: any) => item.$meta.dynamic_JSON.a === 1) + ).toBeTruthy(); }); it(`Upsert Data on different scalar fields`, async () => { From 7d913e746e45eaf62c58d0697b26344f752574ce Mon Sep 17 00:00:00 2001 From: ryjiang Date: Fri, 27 Dec 2024 10:59:28 +0800 Subject: [PATCH 2/2] add more test Signed-off-by: ryjiang --- test/grpc/Upsert.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/grpc/Upsert.spec.ts b/test/grpc/Upsert.spec.ts index 7b790281..2360fdf8 100644 --- a/test/grpc/Upsert.spec.ts +++ b/test/grpc/Upsert.spec.ts @@ -210,6 +210,7 @@ describe(`Upsert API`, () => { item.dynamic_upserted_int32 = 100; item.$meta.dynamic_varChar = 'test'; item.dynamic_JSON = { a: 1 }; + item.int32_array = null; return item; }); @@ -243,6 +244,10 @@ describe(`Upsert API`, () => { expect( query2.data.every((item: any) => item.$meta.dynamic_JSON.a === 1) ).toBeTruthy(); + // check the int32_array field + expect( + query2.data.every((item: any) => item.int32_array === null) + ).toBeTruthy(); }); it(`Upsert Data on different scalar fields`, async () => {