import React from 'react'; import App from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; describe('App', () => { mountTest(App); rtlTest(App); it('single', () => { // Sub page const MyPage = () => { const { message } = App.useApp(); React.useEffect(() => { message.success('Good!'); }, [message]); return
Hello World
; }; // Entry component const MyApp = () => ( ); const { getByText, container } = render(); expect(getByText('Hello World')).toBeTruthy(); expect(container.firstChild).toMatchSnapshot(); }); });