@@ -56,56 +56,56 @@ describe('utils', function () {
5656
5757
5858 describe ( 'removeEmptyFirestoreProperties' , function ( ) {
59-
59+ var serverTime = Date . now ( ) ;
6060 it ( 'should return null, when the obj is empty' , function ( ) {
61- expect ( removeEmptyFirestoreProperties ( { } ) ) . to . eql ( { } ) ;
61+ expect ( removeEmptyFirestoreProperties ( { } ) , serverTime ) . to . eql ( { } ) ;
6262 } ) ;
6363
6464 it ( 'should make no changes, when obj does not contain an empty property' , function ( ) {
65- expect ( removeEmptyFirestoreProperties ( { a : 1 } ) ) . to . eql ( { a : 1 } ) ;
65+ expect ( removeEmptyFirestoreProperties ( { a : 1 } , serverTime ) ) . to . eql ( { a : 1 } ) ;
6666 } ) ;
6767
6868 it ( 'should make no changes, when obj is a bool' , function ( ) {
69- expect ( removeEmptyFirestoreProperties ( true ) ) . to . eql ( true ) ;
69+ expect ( removeEmptyFirestoreProperties ( true , serverTime ) ) . to . eql ( true ) ;
7070 } ) ;
7171
7272 it ( 'should make no changes, when obj is a string' , function ( ) {
73- expect ( removeEmptyFirestoreProperties ( 'hi' ) ) . to . eql ( 'hi' ) ;
73+ expect ( removeEmptyFirestoreProperties ( 'hi' , serverTime ) ) . to . eql ( 'hi' ) ;
7474 } ) ;
7575
7676 it ( 'should make no changes, when obj is a number' , function ( ) {
77- expect ( removeEmptyFirestoreProperties ( 123 ) ) . to . eql ( 123 ) ;
77+ expect ( removeEmptyFirestoreProperties ( 123 , serverTime ) ) . to . eql ( 123 ) ;
7878 } ) ;
7979
8080 it ( 'should make no changes, when obj is a Date' , function ( ) {
8181 var date = new Date ( ) ;
82- expect ( removeEmptyFirestoreProperties ( date ) ) . to . eql ( date ) ;
82+ expect ( removeEmptyFirestoreProperties ( date , serverTime ) ) . to . eql ( date ) ;
8383 } ) ;
8484
8585 it ( 'should make no changes, when obj is a Timestamp' , function ( ) {
8686 var ts = new Timestamp ( 123 , 123 ) ;
87- expect ( removeEmptyFirestoreProperties ( ts ) ) . to . eql ( ts ) ;
87+ expect ( removeEmptyFirestoreProperties ( ts , serverTime ) ) . to . eql ( ts ) ;
8888 } ) ;
8989
9090 it ( 'should make no changes, when obj is a NaN' , function ( ) {
91- expect ( removeEmptyFirestoreProperties ( NaN ) ) . to . eql ( NaN ) ;
91+ expect ( removeEmptyFirestoreProperties ( NaN , serverTime ) ) . to . eql ( NaN ) ;
9292 } ) ;
9393
9494 it ( 'should make no changes, when obj is a undefined' , function ( ) {
95- expect ( removeEmptyFirestoreProperties ( undefined ) ) . to . eql ( undefined ) ;
95+ expect ( removeEmptyFirestoreProperties ( undefined , serverTime ) ) . to . eql ( undefined ) ;
9696 } ) ;
9797
9898 it ( 'should remove property, when it is null' , function ( ) {
99- expect ( removeEmptyFirestoreProperties ( { a : 1 , b : null } ) ) . to . eql ( { a : 1 , b : null } ) ;
99+ expect ( removeEmptyFirestoreProperties ( { a : 1 , b : null } , serverTime ) ) . to . eql ( { a : 1 , b : null } ) ;
100100 } ) ;
101101 it ( 'should remove property, when it is an empty object' , function ( ) {
102- expect ( removeEmptyFirestoreProperties ( { a : 1 , b : { } } ) ) . to . eql ( { a : 1 , b : { } } ) ;
102+ expect ( removeEmptyFirestoreProperties ( { a : 1 , b : { } } , serverTime ) ) . to . eql ( { a : 1 , b : { } } ) ;
103103 } ) ;
104104 it ( 'should remove property, when it is an empty array' , function ( ) {
105- expect ( removeEmptyFirestoreProperties ( { a : 1 , b : [ ] } ) ) . to . eql ( { a : 1 , b : [ ] } ) ;
105+ expect ( removeEmptyFirestoreProperties ( { a : 1 , b : [ ] } , serverTime ) ) . to . eql ( { a : 1 , b : [ ] } ) ;
106106 } ) ;
107107 it ( 'should return null, when all properties are null ' , function ( ) {
108- expect ( removeEmptyFirestoreProperties ( { a : { b : null } } ) ) . to . eql ( { a : { b : null } } ) ;
108+ expect ( removeEmptyFirestoreProperties ( { a : { b : null } } , serverTime ) ) . to . eql ( { a : { b : null } } ) ;
109109 } ) ;
110110 } ) ;
111111
0 commit comments