()
| 1528 | |
| 1529 | describe(`nested includes: Collection → toArray`, () => { |
| 1530 | function buildCollectionToArrayQuery() { |
| 1531 | return createLiveQueryCollection((q) => |
| 1532 | q.from({ p: projects }).select(({ p }) => ({ |
| 1533 | id: p.id, |
| 1534 | name: p.name, |
| 1535 | issues: q |
| 1536 | .from({ i: issues }) |
| 1537 | .where(({ i }) => eq(i.projectId, p.id)) |
| 1538 | .select(({ i }) => ({ |
| 1539 | id: i.id, |
| 1540 | title: i.title, |
| 1541 | comments: toArray( |
| 1542 | q |
| 1543 | .from({ c: comments }) |
| 1544 | .where(({ c }) => eq(c.issueId, i.id)) |
| 1545 | .select(({ c }) => ({ |
| 1546 | id: c.id, |
| 1547 | body: c.body, |
| 1548 | })), |
| 1549 | ), |
| 1550 | })), |
| 1551 | })), |
| 1552 | ) |
| 1553 | } |
| 1554 | |
| 1555 | it(`initial load: issues are Collections, comments are arrays`, async () => { |
| 1556 | const collection = buildCollectionToArrayQuery() |
no test coverage detected
searching dependent graphs…