From a1bfbce40e143d35bc85cb60952296d9d5558163 Mon Sep 17 00:00:00 2001 From: Ferdinando Papale <4850119+papafe@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:38:32 +0200 Subject: [PATCH] Small corrections to queries --- integration-tests/tests/src/tests/queries.ts | 33 ++------------------ 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/integration-tests/tests/src/tests/queries.ts b/integration-tests/tests/src/tests/queries.ts index 890edbb0ee..c3f7f90b13 100644 --- a/integration-tests/tests/src/tests/queries.ts +++ b/integration-tests/tests/src/tests/queries.ts @@ -133,25 +133,6 @@ class PointOfInterest extends Realm.Object implements IPointOfInterest { }; } -interface ICompany { - id: number; - locations: MyGeoPoint[]; -} - -class Company extends Realm.Object implements ICompany { - id = 0; - locations: [MyGeoPoint] = [new MyGeoPoint(0, 0)]; - - static schema: ObjectSchema = { - name: "Company", - properties: { - id: "int", - locations: "MyGeoPoint[]", - }, - primaryKey: "id", - }; -} - type QueryLengthPair = [ExpectedLength: number, Query: string, ...QueryArgs: Array]; type QueryExceptionPair = [ExpectedException: string, Query: string, ...QueryArgs: Array]; type QueryResultsPair = [ExpectedResults: any[], Query: string, ...QueryArgs: Array]; @@ -209,7 +190,7 @@ const expectQueryResultValues = ( queryResultPairs.forEach(([expectedResults, queryString, ...queryArgs]) => { let results = realm.objects(objectSchema); results = results.filtered(queryString, ...queryArgs); - console.log(results.map((el) => el[propertyToCompare])); //TODO For testing, can be removed later + //console.log(results.map((el) => el[propertyToCompare])); //TODO For testing, can be removed later expect(results.length).to.equal(expectedResults.length); expect(results.map((el) => el[propertyToCompare])).to.deep.equal( expectedResults, @@ -222,7 +203,7 @@ const expectQueryResultValues = ( describe("Queries", () => { describe.only("GeoSpatial", () => { - openRealmBeforeEach({ schema: [PointOfInterest, Company, MyGeoPoint.schema] }); + openRealmBeforeEach({ schema: [PointOfInterest, MyGeoPoint.schema] }); const zero: IPointOfInterest = { id: 1, location: new MyGeoPoint(0, 0), @@ -736,16 +717,6 @@ describe("Queries", () => { ]); }); - //TODO Need to re-enable when we know if we can do this or not - it.skip("Box around north pole", function (this: RealmContext) { - const box: GeoBox = { - bottomLeft: [6, 89], - topRight: [160, 89], - }; - - geoTest(this.realm, box, [northPole]); - }); - it("Circle around north pole", function (this: RealmContext) { const circle: GeoCircle = { center: [0, 90],