mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 23:46:35 +00:00
fix(assistant): taking a proposal needs place rights, and a card's choices wait while a change runs
Plan this checks place_edit like the tour routes, the include choices of a run or group stay disabled while the chat applies a change, and a follow-up can say when it applies, so Confirm the pending bookings shows only when the card holds a pending booking of this trip.
This commit is contained in:
@@ -150,10 +150,11 @@ describe('AssistantController', () => {
|
||||
expect(() => controller.addFoundPlace(user, '5', 'x', body)).toThrow(DomainError);
|
||||
});
|
||||
|
||||
it('ASTCTL-008: sharing needs the right to write in the trip chat; nothing else here asks for a right', () => {
|
||||
it('ASTCTL-008: sharing asks for the trip chat right, "Plan this" for editing places; nothing else asks', () => {
|
||||
const handlers = AssistantController.prototype as unknown as Record<string, object>;
|
||||
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers.share)).toBe('collab_edit');
|
||||
for (const name of ['chat', 'decide', 'undo', 'addFoundPlace', 'takeProposal']) {
|
||||
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers.takeProposal)).toBe('place_edit');
|
||||
for (const name of ['chat', 'decide', 'undo', 'addFoundPlace']) {
|
||||
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers[name]), name).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user