* feat: automate prod deployments issue #338 * fix: string parse * feat: add date picker and filter options issue #127 * feat: add tooltip and date picker * ci: split stage deploy into separate tasks to allow separate releases * test: add more test cases * ci: split workflows into client and server * ci: fix pr server workflow
29 lines
793 B
TypeScript
29 lines
793 B
TypeScript
import React from 'react';
|
|
import { test, vi } from 'vitest';
|
|
import App from '../App';
|
|
import { act, render } from '@testing-library/react';
|
|
import AuthContext from '../context/AuthContext';
|
|
import authContextMock from './__mocks__/authContextMock';
|
|
import SidebarContext from '../context/SidebarContext';
|
|
|
|
const sidebarContextMock = {
|
|
currentPage: '/home',
|
|
setNewPage: vi.fn()
|
|
};
|
|
|
|
vi.mock('react-charts', () => ({
|
|
Chart: ({ options }) => <div data-testid="mocked-chart">Mocked Chart</div>
|
|
}));
|
|
|
|
test('Renders the app', async () => {
|
|
await act(async () => {
|
|
render(
|
|
<AuthContext.Provider value={authContextMock}>
|
|
<SidebarContext.Provider value={sidebarContextMock}>
|
|
<App />
|
|
</SidebarContext.Provider>
|
|
</AuthContext.Provider>
|
|
);
|
|
});
|
|
});
|