clean routes
This commit is contained in:
@@ -12,7 +12,6 @@ describe('AuthService', () => {
|
||||
signup: vi.fn(),
|
||||
login: vi.fn(),
|
||||
logout: vi.fn(),
|
||||
getIracingAuthUrl: vi.fn(),
|
||||
} as Mocked<AuthApiClient>;
|
||||
|
||||
service = new AuthService(mockApiClient);
|
||||
@@ -118,29 +117,4 @@ describe('AuthService', () => {
|
||||
await expect(service.logout()).rejects.toThrow('Logout failed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getIracingAuthUrl', () => {
|
||||
it('should call apiClient.getIracingAuthUrl with returnTo', () => {
|
||||
const returnTo = '/dashboard';
|
||||
const expectedUrl = 'https://api.example.com/auth/iracing/start?returnTo=%2Fdashboard';
|
||||
|
||||
mockApiClient.getIracingAuthUrl.mockReturnValue(expectedUrl);
|
||||
|
||||
const result = service.getIracingAuthUrl(returnTo);
|
||||
|
||||
expect(mockApiClient.getIracingAuthUrl).toHaveBeenCalledWith(returnTo);
|
||||
expect(result).toBe(expectedUrl);
|
||||
});
|
||||
|
||||
it('should call apiClient.getIracingAuthUrl without returnTo', () => {
|
||||
const expectedUrl = 'https://api.example.com/auth/iracing/start';
|
||||
|
||||
mockApiClient.getIracingAuthUrl.mockReturnValue(expectedUrl);
|
||||
|
||||
const result = service.getIracingAuthUrl();
|
||||
|
||||
expect(mockApiClient.getIracingAuthUrl).toHaveBeenCalledWith(undefined);
|
||||
expect(result).toBe(expectedUrl);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user