mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 06:37:33 +00:00
test(trips): the removal names who removed
This commit is contained in:
@@ -174,7 +174,7 @@ describe('TripMembersController', () => {
|
||||
expect(await tc(s).removeMember(user, '9', '1', 'sock')).toEqual({ success: true });
|
||||
// The parsed trip id, as the removal itself takes it; member:removed goes out from the use case.
|
||||
expect(writes.removeMember).toHaveBeenCalledWith(9, 1, restWriter('sock'));
|
||||
expect(removeMember).toHaveBeenCalledWith(9, 1);
|
||||
expect(removeMember).toHaveBeenCalledWith(9, 1, 1);
|
||||
expect(await thrown(() => tc(s).removeMember(user, '9', '2'))).toEqual({
|
||||
status: 403,
|
||||
body: { error: 'No permission to remove members' },
|
||||
|
||||
@@ -371,7 +371,7 @@ describe('TripsRpc membership', () => {
|
||||
it('TRIPS-RPC-017 a non-owner member is removed', async () => {
|
||||
const f = build();
|
||||
expect((await f.host().dispatch(req('trips.removeMember', { tripId: 1, userId: 7 }), 42)).ok).toBe(true);
|
||||
expect(f.roster.removeMember).toHaveBeenCalledWith(1, 7);
|
||||
expect(f.roster.removeMember).toHaveBeenCalledWith(1, 7, 42);
|
||||
expect(f.realtime.broadcast).toHaveBeenCalledWith(1, 'member:removed', { userId: 7 });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user