mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 17:41:51 +00:00
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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user