jan/web/containers/Providers/Theme.test.tsx
Faisal Amir 19a60bc973
test: added more test inside containers component (#3765)
* test: wip several component under containers

* remoce checkbox test containers

* test: added more test to containers component
2024-10-16 09:45:28 +07:00

25 lines
649 B
TypeScript

import '@testing-library/jest-dom'
import React from 'react'
import { render } from '@testing-library/react'
import ThemeWrapper from './Theme'
// Mock the ThemeProvider from next-themes
jest.mock('next-themes', () => ({
ThemeProvider: ({ children }: { children: React.ReactNode }) => (
<div>{children}</div>
),
}))
describe('ThemeWrapper', () => {
it('renders children within ThemeProvider', () => {
const { getByText } = render(
<ThemeWrapper>
<div>Child Component</div>
</ThemeWrapper>
)
// Check if the child component is rendered
expect(getByText('Child Component')).toBeInTheDocument()
})
})