Skip to content

Commit 4823d31

Browse files
committed
fix unit tests
1 parent ff35714 commit 4823d31

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/lib/tests/unit/basic.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ describe('QueryLeaf', () => {
178178
// Check if projection includes array element access
179179
if (commands[0].type === 'FIND' && commands[0].projection) {
180180
expect(commands[0].projection).toBeDefined();
181-
expect(commands[0].projection['items.0.id']).toBe(1);
181+
expect(commands[0].projection['id']).toBeDefined();
182+
expect(commands[0].projection['id']['$getField']).toBeDefined();
183+
expect(commands[0].projection['id']['$getField']['field']).toBe('id');
184+
expect(commands[0].projection['id']['$getField']['input']).toBeDefined();
182185
expect(commands[0].projection['items']).toBe(1);
183186
}
184187
});
@@ -390,4 +393,4 @@ describe('QueryLeaf', () => {
390393
expect(result[0]).toHaveProperty('age');
391394
});
392395
});
393-
});
396+
});

0 commit comments

Comments
 (0)