@@ -36,8 +36,8 @@ describe('AngularFirestoreDocument', () => {
3636
3737 it ( 'should get unwrapped snapshot' , async ( done : any ) => {
3838 const randomCollectionName = afs . firestore . collection ( 'a' ) . doc ( ) . id ;
39- const ref = afs . firestore . doc ( `${ randomCollectionName } /FAKE` ) as firebase . firestore . DocumentReference < Stock > ;
40- const stock = new AngularFirestoreDocument ( ref , afs ) ;
39+ const ref = afs . firestore . doc ( `${ randomCollectionName } /FAKE` ) as DocumentReference < Stock > ;
40+ const stock = new AngularFirestoreDocument < Stock > ( ref , afs ) ;
4141 await stock . set ( FAKE_STOCK_DATA ) ;
4242 const obs$ = stock . valueChanges ( ) ;
4343 obs$ . pipe ( take ( 1 ) ) . subscribe ( async data => {
@@ -46,10 +46,9 @@ describe('AngularFirestoreDocument', () => {
4646 } ) ;
4747 } ) ;
4848
49- /* TODO(jamesdaniels): test is flaking, look into this
5049 it ( 'should optionally map the doc ID to the emitted data object' , async ( done : any ) => {
5150 const randomCollectionName = afs . firestore . collection ( 'a' ) . doc ( ) . id ;
52- const ref = afs.firestore.doc(`${randomCollectionName}/FAKE`);
51+ const ref = afs . firestore . doc ( `${ randomCollectionName } /FAKE` ) as DocumentReference < Stock > ;
5352 const stock = new AngularFirestoreDocument < Stock > ( ref , afs ) ;
5453 await stock . set ( FAKE_STOCK_DATA ) ;
5554 const idField = 'myCustomID' ;
@@ -59,7 +58,7 @@ describe('AngularFirestoreDocument', () => {
5958 expect ( data ) . toEqual ( jasmine . objectContaining ( FAKE_STOCK_DATA ) ) ;
6059 stock . delete ( ) . then ( done ) . catch ( done . fail ) ;
6160 } ) ;
62- });*/
61+ } ) ;
6362
6463 } ) ;
6564
@@ -81,18 +80,6 @@ describe('AngularFirestoreDocument', () => {
8180 } ) ;
8281 } ) ;
8382
84- it ( 'should get unwrapped snapshot' , async ( done : any ) => {
85- const randomCollectionName = afs . firestore . collection ( 'a' ) . doc ( ) . id ;
86- const ref = afs . firestore . doc ( `${ randomCollectionName } /FAKE` ) as DocumentReference < Stock > ;
87- const stock = new AngularFirestoreDocument < Stock > ( ref , afs ) ;
88- await stock . set ( FAKE_STOCK_DATA ) ;
89- const obs$ = stock . valueChanges ( ) ;
90- obs$ . pipe ( take ( 1 ) ) . subscribe ( async data => {
91- expect ( data ) . toEqual ( FAKE_STOCK_DATA ) ;
92- stock . delete ( ) . then ( done ) . catch ( done . fail ) ;
93- } ) ;
94- } ) ;
95-
9683 } ) ;
9784
9885} ) ;
0 commit comments