UNPKG

@yoroi/common

Version:
24 lines (23 loc) 825 B
"use strict"; import { render } from '@testing-library/react-native'; import * as React from 'react'; import { Text } from 'react-native'; import { SuspenseBoundary } from './SuspenseBoundary'; import { jsx as _jsx } from "react/jsx-runtime"; const LazyComponent = /*#__PURE__*/React.lazy(() => Promise.resolve({ default: () => /*#__PURE__*/_jsx(Text, { children: "Lazy Component Loaded" }) })); describe('SuspenseBoundary Component', () => { it('renders fallback content while suspending', async () => { const { findByTestId } = render(/*#__PURE__*/_jsx(SuspenseBoundary, { children: /*#__PURE__*/_jsx(LazyComponent, {}) })); const fallbackContent = await findByTestId('suspending'); expect(fallbackContent).toBeTruthy(); }); }); //# sourceMappingURL=SuspenseBoundary.test.js.map