feat(cloudflare): add domain move and batch operations in group detail page

This commit is contained in:
ryan
2026-09-26 15:26:37 +08:00
parent 4d52a5b097
commit 11c8e5c7f3
7 changed files with 713 additions and 17 deletions
@@ -55,4 +55,29 @@ describe('CloudflareService', () => {
undefined,
);
});
it('calls move and batch member endpoints with correct paths and payloads', async () => {
vi.mocked(apiClient.post).mockResolvedValue(response({}));
await CloudflareService.moveMember(7, 9, 8);
expect(apiClient.post).toHaveBeenCalledWith(
'/api/v1/d/cloudflare/groups/7/members/9/move',
{ target_group_id: 8 },
undefined,
);
await CloudflareService.batchMoveMembers(7, [9, 10], 8);
expect(apiClient.post).toHaveBeenCalledWith(
'/api/v1/d/cloudflare/groups/7/members/batch-move',
{ member_ids: [9, 10], target_group_id: 8 },
undefined,
);
await CloudflareService.batchRemoveMembers(7, [9, 10]);
expect(apiClient.post).toHaveBeenCalledWith(
'/api/v1/d/cloudflare/groups/7/members/batch-remove',
{ member_ids: [9, 10] },
undefined,
);
});
});