Fix i18next warning in frontend tests

- Initialize i18n in test setup to suppress 'NO_I18NEXT_INSTANCE' warning
- Update AMSHistoryModal tests to use actual translated text

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
maziggy
2025-12-14 09:54:36 +01:00
co-authored by Claude Opus 4.5
parent 76795b5fe2
commit dc92816515
2 changed files with 5 additions and 2 deletions
@@ -243,7 +243,7 @@ describe('AMSHistoryModal', () => {
render(<AMSHistoryModal {...defaultProps} />);
await waitFor(() => {
expect(screen.getByText('Error loading data')).toBeInTheDocument();
expect(screen.getByText('Error')).toBeInTheDocument();
});
});
@@ -261,7 +261,7 @@ describe('AMSHistoryModal', () => {
render(<AMSHistoryModal {...defaultProps} />);
await waitFor(() => {
expect(screen.getByText('No data available for this time range')).toBeInTheDocument();
expect(screen.getByText('No data available')).toBeInTheDocument();
});
});
+3
View File
@@ -8,6 +8,9 @@ import { afterAll, afterEach, beforeAll, vi } from 'vitest';
import { cleanup } from '@testing-library/react';
import { server } from './mocks/server';
// Initialize i18n for tests (suppresses react-i18next warnings)
import '../i18n';
// Setup MSW server - bypass WebSocket requests so our mock handles them
beforeAll(() =>
server.listen({