@@ -57,7 +57,9 @@ import {
57
57
collectionGroup ,
58
58
SetOptions ,
59
59
UpdateData ,
60
- DocumentData
60
+ DocumentData ,
61
+ WithFieldValue ,
62
+ NestedPartialWithFieldValue
61
63
} from '../../src/lite/reference' ;
62
64
import {
63
65
addDoc ,
@@ -337,10 +339,13 @@ describe('getDoc()', () => {
337
339
* DocumentReference-based mutation API.
338
340
*/
339
341
interface MutationTester {
340
- set < T > ( documentRef : DocumentReference < T > , data : T ) : Promise < void > ;
341
342
set < T > (
342
343
documentRef : DocumentReference < T > ,
343
- data : Partial < T > ,
344
+ data : WithFieldValue < T >
345
+ ) : Promise < void > ;
346
+ set < T > (
347
+ documentRef : DocumentReference < T > ,
348
+ data : NestedPartialWithFieldValue < T > ,
344
349
options : SetOptions
345
350
) : Promise < void > ;
346
351
update (
@@ -580,7 +585,11 @@ function genericMutationTests(
580
585
const coll = collection ( db , 'posts' ) ;
581
586
const ref = doc ( coll , 'post' ) . withConverter ( postConverterMerge ) ;
582
587
await setDoc ( ref , new Post ( 'walnut' , 'author' ) ) ;
583
- await setDoc ( ref , { title : 'olive' } , { merge : true } ) ;
588
+ await setDoc (
589
+ ref ,
590
+ { title : 'olive' , id : increment ( 2 ) } ,
591
+ { merge : true }
592
+ ) ;
584
593
const postDoc = await getDoc ( ref ) ;
585
594
expect ( postDoc . get ( 'title' ) ) . to . equal ( 'olive' ) ;
586
595
expect ( postDoc . get ( 'author' ) ) . to . equal ( 'author' ) ;
0 commit comments