@@ -36,8 +36,8 @@ describe('AngularFirestoreDocument', () => {
36
36
37
37
it ( 'should get unwrapped snapshot' , async ( done : any ) => {
38
38
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 ) ;
41
41
await stock . set ( FAKE_STOCK_DATA ) ;
42
42
const obs$ = stock . valueChanges ( ) ;
43
43
obs$ . pipe ( take ( 1 ) ) . subscribe ( async data => {
@@ -46,10 +46,9 @@ describe('AngularFirestoreDocument', () => {
46
46
} ) ;
47
47
} ) ;
48
48
49
- /* TODO(jamesdaniels): test is flaking, look into this
50
49
it ( 'should optionally map the doc ID to the emitted data object' , async ( done : any ) => {
51
50
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 > ;
53
52
const stock = new AngularFirestoreDocument < Stock > ( ref , afs ) ;
54
53
await stock . set ( FAKE_STOCK_DATA ) ;
55
54
const idField = 'myCustomID' ;
@@ -59,7 +58,7 @@ describe('AngularFirestoreDocument', () => {
59
58
expect ( data ) . toEqual ( jasmine . objectContaining ( FAKE_STOCK_DATA ) ) ;
60
59
stock . delete ( ) . then ( done ) . catch ( done . fail ) ;
61
60
} ) ;
62
- });*/
61
+ } ) ;
63
62
64
63
} ) ;
65
64
@@ -81,18 +80,6 @@ describe('AngularFirestoreDocument', () => {
81
80
} ) ;
82
81
} ) ;
83
82
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
-
96
83
} ) ;
97
84
98
85
} ) ;
0 commit comments