@@ -299,14 +299,11 @@ describe('Database', function () {
299
299
let databaseV9Deprecation : CheckV9DeprecationFunction ;
300
300
let staticsV9Deprecation : CheckV9DeprecationFunction ;
301
301
let referenceV9Deprecation : CheckV9DeprecationFunction ;
302
- let queryV9Deprecation : CheckV9DeprecationFunction ;
303
302
304
303
beforeEach ( function ( ) {
305
304
databaseV9Deprecation = createCheckV9Deprecation ( [ 'database' ] ) ;
306
305
staticsV9Deprecation = createCheckV9Deprecation ( [ 'database' , 'statics' ] ) ;
307
306
referenceV9Deprecation = createCheckV9Deprecation ( [ 'database' , 'DatabaseReference' ] ) ;
308
- queryV9Deprecation = createCheckV9Deprecation ( [ 'database' , 'DatabaseQuery' ] ) ;
309
-
310
307
// @ts -ignore test
311
308
jest . spyOn ( FirebaseModule . prototype , 'native' , 'get' ) . mockImplementation ( ( ) => {
312
309
return new Proxy (
@@ -505,13 +502,11 @@ describe('Database', function () {
505
502
'once' ,
506
503
) ;
507
504
} ) ;
508
- } ) ;
509
505
510
- describe ( 'DatabaseQuery' , function ( ) {
511
506
it ( 'endAt' , function ( ) {
512
507
const db = getDatabase ( ) ;
513
508
const testRef = ref ( db , 'test' ) ;
514
- queryV9Deprecation (
509
+ referenceV9Deprecation (
515
510
( ) => query ( testRef , endAt ( 'value' ) ) ,
516
511
( ) => testRef . endAt ( 'value' ) ,
517
512
'endAt' ,
@@ -521,7 +516,7 @@ describe('Database', function () {
521
516
it ( 'startAt' , function ( ) {
522
517
const db = getDatabase ( ) ;
523
518
const testRef = ref ( db , 'test' ) ;
524
- queryV9Deprecation (
519
+ referenceV9Deprecation (
525
520
( ) => query ( testRef , startAt ( 'value' ) ) ,
526
521
( ) => testRef . startAt ( 'value' ) ,
527
522
'startAt' ,
@@ -531,7 +526,7 @@ describe('Database', function () {
531
526
it ( 'limitToFirst' , function ( ) {
532
527
const db = getDatabase ( ) ;
533
528
const testRef = ref ( db , 'test' ) ;
534
- queryV9Deprecation (
529
+ referenceV9Deprecation (
535
530
( ) => query ( testRef , limitToFirst ( 10 ) ) ,
536
531
( ) => testRef . limitToFirst ( 10 ) ,
537
532
'limitToFirst' ,
@@ -541,7 +536,7 @@ describe('Database', function () {
541
536
it ( 'limitToLast' , function ( ) {
542
537
const db = getDatabase ( ) ;
543
538
const testRef = ref ( db , 'test' ) ;
544
- queryV9Deprecation (
539
+ referenceV9Deprecation (
545
540
( ) => query ( testRef , limitToLast ( 10 ) ) ,
546
541
( ) => testRef . limitToLast ( 10 ) ,
547
542
'limitToLast' ,
@@ -551,7 +546,7 @@ describe('Database', function () {
551
546
it ( 'orderByChild' , function ( ) {
552
547
const db = getDatabase ( ) ;
553
548
const testRef = ref ( db , 'test' ) ;
554
- queryV9Deprecation (
549
+ referenceV9Deprecation (
555
550
( ) => query ( testRef , orderByChild ( 'name' ) ) ,
556
551
( ) => testRef . orderByChild ( 'name' ) ,
557
552
'orderByChild' ,
@@ -561,7 +556,7 @@ describe('Database', function () {
561
556
it ( 'orderByKey' , function ( ) {
562
557
const db = getDatabase ( ) ;
563
558
const testRef = ref ( db , 'test' ) ;
564
- queryV9Deprecation (
559
+ referenceV9Deprecation (
565
560
( ) => query ( testRef , orderByKey ( ) ) ,
566
561
( ) => testRef . orderByKey ( ) ,
567
562
'orderByKey' ,
@@ -571,7 +566,7 @@ describe('Database', function () {
571
566
it ( 'orderByValue' , function ( ) {
572
567
const db = getDatabase ( ) ;
573
568
const testRef = ref ( db , 'test' ) ;
574
- queryV9Deprecation (
569
+ referenceV9Deprecation (
575
570
( ) => query ( testRef , orderByValue ( ) ) ,
576
571
( ) => testRef . orderByValue ( ) ,
577
572
'orderByValue' ,
@@ -581,12 +576,64 @@ describe('Database', function () {
581
576
it ( 'equalTo' , function ( ) {
582
577
const db = getDatabase ( ) ;
583
578
const testRef = ref ( db , 'test' ) ;
584
- queryV9Deprecation (
579
+ referenceV9Deprecation (
585
580
( ) => query ( testRef , equalTo ( 'value' ) ) ,
586
581
( ) => testRef . equalTo ( 'value' ) ,
587
582
'equalTo' ,
588
583
) ;
589
584
} ) ;
585
+
586
+ it ( 'setPriority' , function ( ) {
587
+ const db = getDatabase ( ) ;
588
+ const testRef = ref ( db , 'test' ) ;
589
+ referenceV9Deprecation (
590
+ ( ) => setPriority ( testRef , 'value' ) ,
591
+ ( ) => testRef . setPriority ( 'value' ) ,
592
+ 'setPriority' ,
593
+ ) ;
594
+ } ) ;
595
+
596
+ it ( 'push' , function ( ) {
597
+ const db = getDatabase ( ) ;
598
+ const testRef = ref ( db , 'test' ) ;
599
+ referenceV9Deprecation (
600
+ ( ) => push ( testRef , 'value' ) ,
601
+ ( ) => testRef . push ( 'value' ) ,
602
+ 'push' ,
603
+ ) ;
604
+ } ) ;
605
+
606
+ it ( 'onDisconnect' , function ( ) {
607
+ const db = getDatabase ( ) ;
608
+ const testRef = ref ( db , 'test' ) ;
609
+ referenceV9Deprecation (
610
+ ( ) => onDisconnect ( testRef ) ,
611
+ ( ) => testRef . onDisconnect ( ) ,
612
+ 'onDisconnect' ,
613
+ ) ;
614
+ } ) ;
615
+
616
+ it ( 'keepSynced' , function ( ) {
617
+ const db = getDatabase ( ) ;
618
+ const testRef = ref ( db , 'test' ) ;
619
+ referenceV9Deprecation (
620
+ ( ) => keepSynced ( testRef , true ) ,
621
+ ( ) => testRef . keepSynced ( true ) ,
622
+ 'keepSynced' ,
623
+ ) ;
624
+ } ) ;
625
+ } ) ;
626
+
627
+ describe ( 'DatabaseTransaction' , function ( ) {
628
+ it ( 'runTransaction' , function ( ) {
629
+ const db = getDatabase ( ) ;
630
+ const testRef = ref ( db , 'test' ) ;
631
+ referenceV9Deprecation (
632
+ ( ) => runTransaction ( testRef , ( currentData ) => currentData , { applyLocally : true } ) ,
633
+ ( ) => testRef . transaction ( ( currentData ) => currentData , undefined , true ) ,
634
+ 'transaction'
635
+ ) ;
636
+ } ) ;
590
637
} ) ;
591
638
} ) ;
592
639
} ) ;
0 commit comments