splitting unit + integration testing apart attempt #1
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m44s

This commit is contained in:
2025-12-01 14:39:17 -08:00
parent 7a6fe5fe75
commit f91c575142
4 changed files with 45 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ describe('AnalysisPanel', () => {
mockedAiApiClient.getQuickInsights.mockReset();
mockedAiApiClient.getDeepDiveAnalysis.mockReset();
mockedAiApiClient.searchWeb.mockReset();
mockedAiApiClient.planTripWithMaps.mockReset(); // Corrected function name
mockedAiApiClient.planTripWithMaps.mockReset();
mockedAiApiClient.generateImageFromText.mockReset();
// Mock Geolocation API
@@ -66,7 +66,6 @@ describe('AnalysisPanel', () => {
it('should switch tabs and update the generate button text', () => {
render(<AnalysisPanel flyerItems={mockFlyerItems} store={mockStore} />);
// The tab elements now correctly have the role 'tab', not 'button'.
fireEvent.click(screen.getByRole('tab', { name: /deep dive/i }));
expect(screen.getByRole('button', { name: /generate deep dive/i })).toBeInTheDocument();
});
@@ -152,7 +151,7 @@ describe('AnalysisPanel', () => {
// It does not display a specific error message in the UI in this case.
// The test should verify that no result is displayed and no API call is made.
await waitFor(() => {
expect(mockedAiApiClient.planTripWithMaps).not.toHaveBeenCalled(); // Corrected function name
expect(mockedAiApiClient.planTripWithMaps).not.toHaveBeenCalled();
expect(screen.queryByText(/Please allow location access/i)).not.toBeInTheDocument();
});
});