Initial Commit

This commit is contained in:
Eric Gullickson
2025-09-17 16:09:15 -05:00
parent 0cdb9803de
commit a052040e3a
373 changed files with 437090 additions and 6773 deletions

View File

@@ -0,0 +1,20 @@
import { renderHook, waitFor } from '@testing-library/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useFuelGrades } from '../../src/features/fuel-logs/hooks/useFuelGrades';
import * as api from '../../src/features/fuel-logs/api/fuel-logs.api';
const qc = new QueryClient();
jest.spyOn(api.fuelLogsApi, 'getFuelGrades').mockResolvedValue([
{ value: '87', label: '87 (Regular)' },
{ value: '91', label: '91 (Premium)' },
]);
describe('useFuelGrades', () => {
it('returns grades for gasoline', async () => {
const wrapper = ({ children }: any) => <QueryClientProvider client={qc}>{children}</QueryClientProvider>;
const { result } = renderHook(() => useFuelGrades('gasoline' as any), { wrapper });
await waitFor(() => expect(result.current.fuelGrades.length).toBeGreaterThan(0));
});
});