Skip to content

Commit 0d7d850

Browse files
committed
adds more autoschema related tests
1 parent b948692 commit 0d7d850

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

src/data/journey.test.ts

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ describe('data', () => {
384384
});
385385
});
386386

387-
it('gets all classes objects with all optional _additional params', () => {
387+
it('gets all classes objects with all optional _additional params', () => {
388388
return client.data
389389
.getter()
390390
.withClassName(thingClassName)
@@ -538,25 +538,44 @@ describe('data', () => {
538538
// alter the schema
539539
const properties: Properties = res.properties!;
540540
properties!.stringProp = 'thing-updated';
541+
properties!.objectProp = {
542+
nestedNumber: 55.5,
543+
nestedText: 'updated text',
544+
nestedObjects: [
545+
{
546+
nestedBoolLvl2: false,
547+
nestedNumbersLvl2: [],
548+
},
549+
{
550+
nestedBoolLvl2: true,
551+
nestedNumbersLvl2: [1.1],
552+
},
553+
{
554+
nestedBoolLvl2: true,
555+
nestedNumbersLvl2: [2.2, 3.3],
556+
},
557+
],
558+
};
541559
return client.data.updater().withId(id).withClassName(thingClassName).withProperties(properties).do();
542560
})
543561
.then((res: WeaviateObject) => {
544562
expect(res.properties).toEqual({
545563
stringProp: 'thing-updated',
546564
objectProp: {
547-
nestedInt: 999,
548-
nestedNumber: 88.8,
549-
nestedText: 'another text',
565+
nestedNumber: 55.5,
566+
nestedText: 'updated text',
550567
nestedObjects: [
551568
{
552569
nestedBoolLvl2: false,
553-
nestedDateLvl2: '2020-01-01T00:00:00+02:00',
554-
nestedNumbersLvl2: [55.5, 66.6],
570+
nestedNumbersLvl2: [],
555571
},
556572
{
557573
nestedBoolLvl2: true,
558-
nestedDateLvl2: '2021-01-01T00:00:00+02:00',
559-
nestedNumbersLvl2: [77.7, 88.8],
574+
nestedNumbersLvl2: [1.1],
575+
},
576+
{
577+
nestedBoolLvl2: true,
578+
nestedNumbersLvl2: [2.2, 3.3],
560579
},
561580
],
562581
},
@@ -583,19 +602,20 @@ describe('data', () => {
583602
expect(res.properties).toEqual({
584603
stringProp: 'thing-updated-with-class-name',
585604
objectProp: {
586-
nestedInt: 999,
587-
nestedNumber: 88.8,
588-
nestedText: 'another text',
605+
nestedNumber: 55.5,
606+
nestedText: 'updated text',
589607
nestedObjects: [
590608
{
591609
nestedBoolLvl2: false,
592-
nestedDateLvl2: '2020-01-01T00:00:00+02:00',
593-
nestedNumbersLvl2: [55.5, 66.6],
610+
nestedNumbersLvl2: [],
611+
},
612+
{
613+
nestedBoolLvl2: true,
614+
nestedNumbersLvl2: [1.1],
594615
},
595616
{
596617
nestedBoolLvl2: true,
597-
nestedDateLvl2: '2021-01-01T00:00:00+02:00',
598-
nestedNumbersLvl2: [77.7, 88.8],
618+
nestedNumbersLvl2: [2.2, 3.3],
599619
},
600620
],
601621
},

0 commit comments

Comments
 (0)