File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/compat/firestore/collection Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -150,19 +150,20 @@ describe('AngularFirestoreCollection', () => {
150150 ( async ( ) => {
151151 const ITEMS = 10 ;
152152 let count = 0 ;
153- const { stocks } = await collectionHarness ( afs , ITEMS ) ;
153+ const { stocks, names } = await collectionHarness ( afs , ITEMS ) ;
154+ const firstName = names [ 0 ] ;
154155 const sub = TestBed . runInInjectionContext ( ( ) => stocks . snapshotChanges ( ) ) . subscribe ( data => {
155156 count = count + 1 ;
156157 // the first time should all be 'added'
157158 if ( count === 1 ) {
158159 // make an update
159- stocks . doc ( names [ 0 ] ) . update ( { price : 2 } ) ;
160+ stocks . doc ( firstName ) . update ( { price : 2 } ) ;
160161 }
161162 // on the second round, make sure the array is still the same
162163 // length but the updated item is now modified
163164 if ( count === 2 ) {
164165 expect ( data . length ) . toEqual ( ITEMS ) ;
165- const change = data . filter ( x => x . payload . doc . id === names [ 0 ] ) [ 0 ] ;
166+ const change = data . filter ( x => x . payload . doc . id === firstName ) [ 0 ] ;
166167 expect ( change . type ) . toEqual ( 'modified' ) ;
167168 sub . unsubscribe ( ) ;
168169 done ( ) ;
You can’t perform that action at this time.
0 commit comments