huge update
This commit is contained in:
34
app/__tests__/components/Toast.test.tsx
Normal file
34
app/__tests__/components/Toast.test.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
import { ToastProvider } from '@/components/Toast';
|
||||
|
||||
// Simple test component
|
||||
const TestComponent = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Toast Test</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderWithToast = (component: React.ReactElement) => {
|
||||
return render(
|
||||
<ToastProvider>
|
||||
{component}
|
||||
</ToastProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('Toast Component', () => {
|
||||
it('renders ToastProvider without crashing', () => {
|
||||
renderWithToast(<TestComponent />);
|
||||
expect(screen.getByText('Toast Test')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('provides toast context', () => {
|
||||
// Simple test to ensure the provider works
|
||||
const { container } = renderWithToast(<TestComponent />);
|
||||
expect(container).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user