refactor(trips): the journal member choice in a hook of its own, the test seed without an await loop

useTripJournalLink had grown past the 120-line limit for a function. The member list (candidates per journal, roles, who is new) is now useJournalMemberChoice. What loaded is kept with the journal it belongs to, so a new pick shows nothing until its own people are in, without resetting state by hand. The integration test adds its trip members with Promise.all.
This commit is contained in:
Maurice
2026-10-18 17:55:41 +02:00
parent fe05afec19
commit 889e88c362
2 changed files with 96 additions and 81 deletions
@@ -53,7 +53,7 @@ async function scene() {
const { user: mia } = await makeUser(orm, { username: 'Mia' });
const { user: stranger } = await makeUser(orm, { username: 'Stranger' });
const trip = await makeTrip(orm, owner.id);
for (const m of [lena, tom, mia]) await addTripMember(orm, trip.id, m.id);
await Promise.all([lena, tom, mia].map((m) => addTripMember(orm, trip.id, m.id)));
const journal = await makeJourney(orm, owner.id, { title: 'New York, the long weekend' });
return { owner, lena, tom, mia, stranger, trip, journal };
}