import { cleanup, render } from '@testing-library/react' import { AppProvider } from './AppProvider' describe('AppProvider', () => { afterEach(cleanup) it('should render children', () => { const { getByText } = render(
Test
) expect(getByText('Test')).toBeInTheDocument() }) it('should set the default theme name to light', () => { render(
) expect(document.documentElement).toHaveAttribute( 'data-bezier-theme', 'light' ) }) it('should set a custom theme name on the root element', () => { render(
) expect(document.documentElement).toHaveAttribute( 'data-bezier-theme', 'dark' ) }) it('should remove data attributes from the root element on cleanup', () => { const { unmount } = render(
) unmount() expect(document.documentElement).not.toHaveAttribute('data-bezier-theme') }) })