updates on the ui and updates agents
This commit is contained in:
@@ -288,9 +288,13 @@ describe('doormile endpoints', () => {
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/admin/bookings/4021/assign-vehicle', { vehicleid: 5 });
|
||||
});
|
||||
|
||||
// ADMIN, not hub. /hub/bookings/batch-assign sits behind HubStaffAuth and
|
||||
// 403s for every token this console issues, so this function could never
|
||||
// succeed while it pointed there. /admin/bookings/batch-assign runs the
|
||||
// same solver (controllers/batchAssignService.go) under admin auth.
|
||||
it('should batch-assign with a default cap of five stops per rider', async () => {
|
||||
await batchAssignBookings([1, 2, 3]);
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/hub/bookings/batch-assign', {
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/admin/bookings/batch-assign', {
|
||||
bookingids: [1, 2, 3],
|
||||
max_per_rider: 5
|
||||
});
|
||||
@@ -298,12 +302,19 @@ describe('doormile endpoints', () => {
|
||||
|
||||
it('should honour an explicit per-rider cap', async () => {
|
||||
await batchAssignBookings([1, 2], 2);
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/hub/bookings/batch-assign', {
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/admin/bookings/batch-assign', {
|
||||
bookingids: [1, 2],
|
||||
max_per_rider: 2
|
||||
});
|
||||
});
|
||||
|
||||
it('should not call the hub-only route, which 403s from this console', async () => {
|
||||
await batchAssignBookings([1]);
|
||||
expect(mockClient.post).not.toHaveBeenCalledWith(
|
||||
'/hub/bookings/batch-assign', expect.anything()
|
||||
);
|
||||
});
|
||||
|
||||
it('should bulk-cancel through the dedicated route', async () => {
|
||||
await bulkCancelBookings([1, 2, 3]);
|
||||
expect(mockClient.post).toHaveBeenCalledWith('/admin/bookings/bulk-cancel', { bookingIds: [1, 2, 3] });
|
||||
|
||||
Reference in New Issue
Block a user