()
| 1867 | ); |
| 1868 | } |
| 1869 | function A() { |
| 1870 | return ( |
| 1871 | <div> |
| 1872 | <Suspense fallback={<C />}> |
| 1873 | <B /> |
| 1874 | </Suspense> |
| 1875 | </div> |
| 1876 | ); |
| 1877 | } |
| 1878 | |
| 1879 | await act(() => { |
| 1880 | const {pipe} = renderToPipeableStream(<A />); |
| 1881 | pipe(writable); |
| 1882 | }); |
| 1883 | |
| 1884 | expect(getVisibleChildren(container)).toEqual( |
| 1885 | <div> |
| 1886 | <incorrecttag>Loading</incorrecttag> |
| 1887 | </div>, |
| 1888 | ); |
| 1889 | |
| 1890 | assertConsoleErrorDev([ |
| 1891 | '<inCorrectTag /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.' + |
| 1892 | '\n' + |
| 1893 | ' in inCorrectTag (at **)\n' + |
| 1894 | ' in C (at **)\n' + |
| 1895 | ' in A (at **)', |
| 1896 | ]); |
| 1897 | |
| 1898 | await act(() => { |
| 1899 | resolveText('Hello'); |
| 1900 | resolveText('World'); |
| 1901 | }); |
| 1902 | |
| 1903 | assertConsoleErrorDev([ |
| 1904 | 'Each child in a list should have a unique "key" prop.\n\nCheck the render method of `B`.' + |
| 1905 | ' See https://react.dev/link/warning-keys for more information.\n' + |
| 1906 | ' in span (at **)\n' + |
| 1907 | ' in mapper (at **)\n' + |
| 1908 | ' in Array.map (at **)\n' + |
| 1909 | ' in B (at **)\n' + |
| 1910 | ' in A (at **)', |
| 1911 | ]); |
| 1912 | |
| 1913 | expect(getVisibleChildren(container)).toEqual( |
| 1914 | <div> |
| 1915 | <div> |
| 1916 | <span>Hello</span> |
| 1917 | <span>World</span> |
| 1918 | </div> |
| 1919 | </div>, |
| 1920 | ); |
| 1921 | }); |
| 1922 | |
| 1923 | // @gate !disableLegacyContext |
| 1924 | it('should can suspend in a class component with legacy context', async () => { |
nothing calls this directly
no test coverage detected