viewer-components-react
viewer-components-react copied to clipboard
Tree widget: Assertion failures when running `createTreeWidget` tests
- Set environment variable
NODE_ENV=development - Run tree widget tests
- Notice the failures:
1) createTreeWidget renders supplied trees: Error: Assert: Programmer Error at assert (node_modules\.pnpm\@[email protected]\node_modules\@itwin\core-bentley\src\Assert.ts:46:9) at useTransientState (node_modules\.pnpm\@[email protected]_infkli3j65rh4rjxdkq4hj547y\node_modules\@itwin\appui-react\src\appui-react\widget-panels\useTransientState.tsx:21:9) at useTreeWidgetTransientState (src\components\TreeWidgetUiItemsProvider.tsx:100:20) at TreeWidgetComponent (src\components\TreeWidgetUiItemsProvider.tsx:73:15) at renderWithHooks (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:16141:18) at mountIndeterminateComponent (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:20838:13) at beginWork (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:22342:16) at beginWork$1 (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:27219:14) at performUnitOfWork (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26395:12) at workLoopSync (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26303:5) at renderRootSync (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26271:7) at recoverFromConcurrentError (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:25689:20) at performConcurrentWorkOnRoot (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:25589:22) at flushActQueue (node_modules\.pnpm\[email protected]\node_modules\react\cjs\react.development.js:2662:24) at act (node_modules\.pnpm\[email protected]\node_modules\react\cjs\react.development.js:2577:11) at E:\itwinjs-1\repos\viewer-components-react\packages\itwin\tree-widget\node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\act-compat.js:46:25 at renderRoot (node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\pure.js:161:26) at render (node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\pure.js:247:10) at customRender (src\test\TestUtils.tsx:204:17) at Context.<anonymous> (src\test\TreeWidgetUiItemsProvider.test.tsx:40:11) 2) createTreeWidget renders error message if tree component throws: Error: Assert: Programmer Error at assert (node_modules\.pnpm\@[email protected]\node_modules\@itwin\core-bentley\src\Assert.ts:46:9) at useTransientState (node_modules\.pnpm\@[email protected]_infkli3j65rh4rjxdkq4hj547y\node_modules\@itwin\appui-react\src\appui-react\widget-panels\useTransientState.tsx:21:9) at useTreeWidgetTransientState (src\components\TreeWidgetUiItemsProvider.tsx:100:20) at TreeWidgetComponent (src\components\TreeWidgetUiItemsProvider.tsx:73:15) at renderWithHooks (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:16141:18) at mountIndeterminateComponent (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:20838:13) at beginWork (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:22342:16) at beginWork$1 (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:27219:14) at performUnitOfWork (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26395:12) at workLoopSync (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26303:5) at renderRootSync (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:26271:7) at recoverFromConcurrentError (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:25689:20) at performConcurrentWorkOnRoot (node_modules\.pnpm\[email protected][email protected]\node_modules\react-dom\cjs\react-dom.development.js:25589:22) at flushActQueue (node_modules\.pnpm\[email protected]\node_modules\react\cjs\react.development.js:2662:24) at act (node_modules\.pnpm\[email protected]\node_modules\react\cjs\react.development.js:2577:11) at E:\itwinjs-1\repos\viewer-components-react\packages\itwin\tree-widget\node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\act-compat.js:46:25 at renderRoot (node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\pure.js:161:26) at render (node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@testing-library\react\dist\pure.js:247:10) at customRender (src\test\TestUtils.tsx:204:17) at Context.<anonymous> (src\test\TreeWidgetUiItemsProvider.test.tsx:68:35)
There is no simple solution for this. Filled issue in AppUI https://github.com/iTwin/appui/issues/1021