Skip to content

Commit 598fd30

Browse files
committed
feat: add test files
1 parent adcc240 commit 598fd30

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2016-present Invertase Limited & Contributors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this library except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
const COLLECTION = 'firestore';
18+
const NO_RULE_COLLECTION = 'no_rules';
19+
const { wipe } = require('../helpers');
20+
import { onSnapshotsInSync } from '../../lib/modular/snapshot';
21+
22+
describe('firestore().doc().onSnapshot()', function () {
23+
before(function () {
24+
return wipe();
25+
});
26+
27+
describe('modular', function () {
28+
it('onSnapshotsInSync() returns an unsubscribe function', function () {
29+
const firestore = firebase.firestore();
30+
const unsubscribe = firestore.onSnapshotsInSync(function () {});
31+
32+
expect(unsubscribe).to.be.a('function');
33+
expect(unsubscribe()).to.equal(undefined);
34+
});
35+
});
36+
});

packages/firestore/lib/modular/snapshot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ export function snapshotEqual(left, right) {
2020
}
2121

2222
export function onSnapshotsInSync(firestore, ...args) {
23-
return firestore.onSnapshotsInSync.call(firestore, ...args, MODULAR_DEPRECATION_ARG);
23+
return firestore.addSnapshotsInSyncListener.call(firestore, ...args, MODULAR_DEPRECATION_ARG);
2424
}

0 commit comments

Comments
 (0)