ci: stabilize pipeline
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import ReactDOMServer from 'react-dom/server';
|
||||
import App from './App';
|
||||
|
||||
jest.mock('axios', () => ({
|
||||
__esModule: true,
|
||||
default: {
|
||||
get: jest.fn(() => Promise.resolve({ data: {} })),
|
||||
interceptors: {
|
||||
request: { use: jest.fn() },
|
||||
response: { use: jest.fn() }
|
||||
}
|
||||
},
|
||||
get: jest.fn(() => Promise.resolve({ data: {} }))
|
||||
}), { virtual: true });
|
||||
|
||||
// Mock the AuthContext
|
||||
jest.mock('./contexts/AuthContext', () => ({
|
||||
useAuth: () => ({
|
||||
@@ -37,7 +49,7 @@ jest.mock('react-hot-toast', () => ({
|
||||
|
||||
describe('App', () => {
|
||||
it('renders without crashing', () => {
|
||||
render(<App />);
|
||||
expect(screen.getByTestId('toaster')).toBeInTheDocument();
|
||||
const markup = ReactDOMServer.renderToStaticMarkup(<App />);
|
||||
expect(markup).toContain('data-testid="toaster"');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user