File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff line change @@ -20,5 +20,5 @@ export function snapshotEqual(left, right) {
2020}
2121
2222export 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}
You can’t perform that action at this time.
0 commit comments