Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and update OR query tests. #11826

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading