Skip to content

Commit

Permalink
Clean up and update OR query tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannas committed Sep 19, 2023
1 parent a69962d commit c2ce01d
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions Firestore/Example/Tests/Integration/API/FIRQueryTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,7 @@ - (void)testOrQueries {
- (void)testOrQueriesWithCompositeIndexes {
// TODO(orquery): Enable this test against production when possible.
XCTSkipIf(![FSTIntegrationTestCase isRunningAgainstEmulator],
"Skip this test if running against production because order-by-equality is not "
"supported yet.");
"Skip this test because prod testing with composite indexes is not supported yet.");

FIRCollectionReference *collRef = [self collectionRefWithDocuments:@{
@"doc1" : @{@"a" : @1, @"b" : @0},
Expand Down Expand Up @@ -986,31 +985,6 @@ - (void)testOrQueriesWithIn {
matchesResult:@[ @"doc3", @"doc4", @"doc6" ]];
}

- (void)testOrQueriesWithNotIn {
// TODO(orquery): Enable this test against production when possible.
XCTSkipIf(![FSTIntegrationTestCase isRunningAgainstEmulator],
"Skip this test if running against production because it results in a 'missing index' "
"error. The Firestore Emulator, however, does serve these queries");

FIRCollectionReference *collRef = [self collectionRefWithDocuments:@{
@"doc1" : @{@"a" : @1, @"b" : @0},
@"doc2" : @{@"b" : @1},
@"doc3" : @{@"a" : @3, @"b" : @2},
@"doc4" : @{@"a" : @1, @"b" : @3},
@"doc5" : @{@"a" : @1},
@"doc6" : @{@"a" : @2}
}];

// a==2 || b not-in [2,3]
// Has implicit orderBy b.
FIRFilter *filter = [FIRFilter orFilterWithFilters:@[
[FIRFilter filterWhereField:@"a" isEqualTo:@2], [FIRFilter filterWhereField:@"b"
notIn:@[ @2, @3 ]]
]];
[self checkOnlineAndOfflineQuery:[collRef queryWhereFilter:filter]
matchesResult:@[ @"doc1", @"doc2" ]];
}

- (void)testOrQueriesWithArrayMembership {
FIRCollectionReference *collRef = [self collectionRefWithDocuments:@{
@"doc1" : @{@"a" : @1, @"b" : @[ @0 ]},
Expand Down Expand Up @@ -1039,10 +1013,6 @@ - (void)testOrQueriesWithArrayMembership {
}

- (void)testMultipleInOps {
// TODO(orquery): Enable this test against production when possible.
XCTSkipIf(![FSTIntegrationTestCase isRunningAgainstEmulator],
"Skip this test if running against production because it's not yet supported.");

FIRCollectionReference *collRef = [self collectionRefWithDocuments:@{
@"doc1" : @{@"a" : @1, @"b" : @0},
@"doc2" : @{@"b" : @1},
Expand Down Expand Up @@ -1071,10 +1041,6 @@ - (void)testMultipleInOps {
}

- (void)testUsingInWithArrayContainsAny {
// TODO(orquery): Enable this test against production when possible.
XCTSkipIf(![FSTIntegrationTestCase isRunningAgainstEmulator],
"Skip this test if running against production because it's not yet supported.");

FIRCollectionReference *collRef = [self collectionRefWithDocuments:@{
@"doc1" : @{@"a" : @1, @"b" : @[ @0 ]},
@"doc2" : @{@"b" : @[ @1 ]},
Expand Down

0 comments on commit c2ce01d

Please sign in to comment.