From 25f8691970a9f765a87ab3125776598c92e02744 Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Tue, 10 Jul 2018 16:58:56 -0700 Subject: Expose array transforms and array contains queries. (#1514) Also remove test code that was combining multiple array contains queries since those were disallowed in https://github.com/firebase/firebase-ios-sdk/commit/0ec836f9ca71b27fa54a11ae9e07e60b8c5cc002 --- .../Example/Tests/Integration/API/FIRQueryTests.mm | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'Firestore/Example/Tests/Integration/API/FIRQueryTests.mm') diff --git a/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm b/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm index bdd3df1..e634d7f 100644 --- a/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm +++ b/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm @@ -20,7 +20,6 @@ #import "Firestore/Example/Tests/Util/FSTEventAccumulator.h" #import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h" -#import "Firestore/Source/API/FIRQuery+Internal.h" @interface FIRQueryTests : FSTIntegrationTestCase @end @@ -293,8 +292,7 @@ ])); } -// TODO(array-features): Enable once backend support lands. -- (void)xtestArrayContainsQueries { +- (void)testArrayContainsQueries { NSDictionary *testDocs = @{ @"a" : @{@"array" : @[ @42 ]}, @"b" : @{@"array" : @[ @"a", @42, @"c" ]}, @@ -314,23 +312,6 @@ @"array2" : @[ @"bingo" ] } ])); - // Search for "array" to contain both @42 and "a". - snapshot = [self readDocumentSetForRef:[[collection queryWhereField:@"array" arrayContains:@42] - queryWhereField:@"array" - arrayContains:@"a"]]; - XCTAssertEqualObjects(FIRQuerySnapshotGetData(snapshot), (@[ - @{ @"array" : @[ @"a", @42, @"c" ] }, - ])); - - // Search two different array fields ("array" contains 42 and "array2" contains "bingo"). - snapshot = [self readDocumentSetForRef:[[collection queryWhereField:@"array" arrayContains:@42] - queryWhereField:@"array2" - arrayContains:@"bingo"]]; - XCTAssertEqualObjects(FIRQuerySnapshotGetData(snapshot), (@[ - @{ @"array" : @[ @42 ], - @"array2" : @[ @"bingo" ] } - ])); - // NOTE: The backend doesn't currently support null, NaN, objects, or arrays, so there isn't much // of anything else interesting to test. } -- cgit v1.2.3