@vulog/aima-user
Version:
User management module for the AIMA platform. This module provides comprehensive functionality to manage users, profiles, billing groups, and user-related operations.
48 lines (43 loc) • 1.26 kB
text/typescript
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest';
import { Client } from '@vulog/aima-client';
import { getFleetBillingGroups } from './getFleetBillingGroups';
describe('getFleetBillingGroups', () => {
const FLEET_ID = 'FLEET_ID';
const getMock = vi.fn();
const client = {
get: getMock,
clientOptions: {
fleetId: FLEET_ID,
},
} as unknown as Client;
beforeEach(() => {
getMock.mockReset();
});
afterEach(() => {
vi.restoreAllMocks();
});
test('should return billing groups', async () => {
const data = [
{
id: '1234',
fleetId: 'FLEET_ID',
name: 'Transit royal',
discount: 10,
overMileageCap: null,
overMileageRate: null,
},
];
getMock.mockResolvedValueOnce({
data,
headers: {
number: 0,
size: 100,
totalelements: 0,
totalpages: 0,
},
});
const result = await getFleetBillingGroups(client);
expect(result).toBeDefined();
expect(result.data).toEqual(data);
});
});