mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 15:17:30 +00:00
feat(journey): the journal settings list who a linked trip lets in
Under the contributors, the journey settings on desktop and phone get a section of their own, Through trips, with everyone a trip's journal link lets in, their role and the trip they come through. It is read only there, since the trip's settings manage it, and it leaves out whoever is a contributor already. getJourneyFull answers it as trip_access.
This commit is contained in:
@@ -171,4 +171,21 @@ describe('TripJournalLinksRepository', () => {
|
||||
expect(await links.findForTrip(s.trip.id)).toBeNull();
|
||||
expect(await links.listMembers(s.trip.id)).toEqual([]);
|
||||
});
|
||||
it('TJLREPO-008: the journal lists who the links let in, per trip, apart from its contributors', async () => {
|
||||
const s = await scene();
|
||||
await links.upsertLink(s.trip.id, s.journal.id, s.owner.id, 1);
|
||||
await links.replaceMembers(
|
||||
s.trip.id,
|
||||
[
|
||||
{ user_id: s.tom.id, role: 'editor' },
|
||||
{ user_id: s.lena.id, role: 'viewer' },
|
||||
],
|
||||
1,
|
||||
);
|
||||
await addJourneyContributor(t, s.journal.id, s.tom.id, 'viewer');
|
||||
|
||||
const access = await contributors.listTripAccessForJourney(s.journal.id);
|
||||
expect(access.map((a) => [a.username, a.role, a.trip_id])).toEqual([['Lena', 'viewer', s.trip.id]]);
|
||||
expect(access[0]?.trip_title).toBe(s.trip.title);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user