Skip to content

fix bug in FUIIndexArray #246

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

Merged
merged 1 commit into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions FirebaseDatabaseUI/FUIQueryObserver.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ + (FUIQueryObserver *)observerForQuery:(id<FUIDataObservable>)query
completion(obs, nil, error);
};

[obs observeEventType:FIRDataEventTypeChildAdded
andPreviousSiblingKeyWithBlock:observerBlock withCancelBlock:cancelBlock];
[obs observeEventType:FIRDataEventTypeValue
andPreviousSiblingKeyWithBlock:observerBlock withCancelBlock:cancelBlock];
return obs;
Expand Down
5 changes: 5 additions & 0 deletions FirebaseDatabaseUITests/FUIDatabaseTestUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ - (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType
id value = self.contents[contentKey];
FUIFakeSnapshot *snap = [[FUIFakeSnapshot alloc] initWithKey:contentKey value:value];
[self sendEvent:FIRDataEventTypeChildAdded withObject:snap previousKey:previousKey error:nil];

// Send a value event, since this is a complete snapshot.
// TODO: FUIFakeSnapshot currently only represents dictionary types, though snapshots can
// have array, string, or number values as well. Tests need to be written for these.
[self sendEvent:FIRDataEventTypeValue withObject:snap previousKey:previousKey error:nil];
previousKey = contentKey;
}
}
Expand Down
2 changes: 1 addition & 1 deletion FirebaseDatabaseUITests/FUIIndexArrayTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ - (void)setUp {
self.index = [[FUITestObservable alloc] initWithDictionary:database()[@"index"]];
self.data = [[FUITestObservable alloc] initWithDictionary:database()[@"data"]];
self.array = [[FUIIndexArray alloc] initWithIndex:self.index
data:self.data];
data:self.data];
self.arrayDelegate = [[FUIIndexArrayTestDelegate alloc] init];
self.array.delegate = self.arrayDelegate;
self.dict = [database() mutableCopy];
Expand Down