()
| 6521 | // For singleton behavior we look up each issue's parent project. |
| 6522 | // Each issue references exactly one project via projectId. |
| 6523 | function buildSingletonQuery() { |
| 6524 | return createLiveQueryCollection((q) => |
| 6525 | q.from({ i: issues }).select(({ i }) => ({ |
| 6526 | id: i.id, |
| 6527 | title: i.title, |
| 6528 | project: materialize( |
| 6529 | q |
| 6530 | .from({ p: projects }) |
| 6531 | .where(({ p }) => eq(p.id, i.projectId)) |
| 6532 | .select(({ p }) => ({ |
| 6533 | id: p.id, |
| 6534 | name: p.name, |
| 6535 | })) |
| 6536 | .findOne(), |
| 6537 | ), |
| 6538 | })), |
| 6539 | ) |
| 6540 | } |
| 6541 | |
| 6542 | it(`findOne() materializes a single value, not an array`, async () => { |
| 6543 | const collection = buildSingletonQuery() |
no test coverage detected