mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-26 13:34:52 +08:00
[firestore] remove unnecessary intern fn _offDocumentSnapshot -> EE already returns a subscription instance with a remove();
[firestore] additionally refactor unsubscribe so it can be called if an error is received on subscribing
This commit is contained in:
@@ -2,6 +2,7 @@ const {
|
||||
test2DocRef,
|
||||
COL2_DOC_1,
|
||||
COL2_DOC_1_ID,
|
||||
cleanCollection,
|
||||
COL2_DOC_1_PATH,
|
||||
TEST_COLLECTION_NAME_DYNAMIC,
|
||||
resetTestCollectionDoc,
|
||||
@@ -126,6 +127,12 @@ describe('firestore()', () => {
|
||||
});
|
||||
|
||||
describe('onSnapshot()', () => {
|
||||
beforeEach(async () => {
|
||||
await sleep(50);
|
||||
await cleanCollection(TEST_COLLECTION_NAME_DYNAMIC);
|
||||
await sleep(50);
|
||||
});
|
||||
|
||||
it('calls callback with the initial data and then when value changes', async () => {
|
||||
await resetTestCollectionDoc(COL2_DOC_1_PATH, { name: 'doc1' });
|
||||
const docRef = test2DocRef(COL2_DOC_1_ID);
|
||||
|
||||
Reference in New Issue
Block a user