Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree widget: Assertion failures when running createTreeWidget tests #1038

Open
grigasp opened this issue Sep 6, 2024 · 1 comment
Open
Assignees
Labels
tree widget Tree widget or its components related issues

Comments

@grigasp
Copy link
Member

grigasp commented Sep 6, 2024

  1. Set environment variable NODE_ENV=development
  2. Run tree widget tests
  3. 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)
@grigasp grigasp added the tree widget Tree widget or its components related issues label Sep 6, 2024
@saskliutas
Copy link
Member

There is no simple solution for this. Filled issue in AppUI iTwin/appui#1021

@saskliutas saskliutas self-assigned this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tree widget Tree widget or its components related issues
Projects
None yet
Development

No branches or pull requests

2 participants