Skip to content

Commit 6a17a52

Browse files
committed
Huh
1 parent 21233f4 commit 6a17a52

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compat/firestore/collection/collection.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)