Skip to content

add unit tests for UserSearchModal component from scratch #595

add unit tests for UserSearchModal component from scratch

add unit tests for UserSearchModal component from scratch #595

GitHub Actions / Jest Unit Test Results failed Dec 27, 2024 in 0s

3 fail, 16 pass in 45s

19 tests  +3   16 ✔️ ±0   45s ⏱️ +21s
  4 suites +1     0 💤 ±0 
  1 files   ±0     3 +3 

Results for commit 1593cd4. ± Comparison against earlier commit cd00fed.

Annotations

Check warning on line 0 in UserSearchModal should display search label

See this annotation in the file changed.

@github-actions github-actions / Jest Unit Test Results

UserSearchModal should display search label (UserSearchModal should display search label) failed

artifacts/jest-junit/junit.xml
Raw output
TypeError: Cannot read properties of undefined (reading 'okapi')
    at okapi (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/src/UserSearchModal.js:72:39)
    at renderWithHooks (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:15486:18)
    at updateForwardRef (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:19245:20)
    at beginWork (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:21675:16)
    at beginWork$1 (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:27465:14)
    at performUnitOfWork (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:26599:12)
    at workLoopSync (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:26505:5)
    at renderRootSync (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:26473:7)
    at recoverFromConcurrentError (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:25889:20)
    at performConcurrentWorkOnRoot (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react-dom/cjs/react-dom.development.js:25789:22)
    at flushActQueue (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react/cjs/react.development.js:2667:24)
    at act (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/react/cjs/react.development.js:2582:11)
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/react/dist/act-compat.js:47:25
    at renderRoot (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/react/dist/pure.js:180:26)
    at render (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/react/dist/pure.js:271:10)
    at Object.<anonymous> (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/src/UserSearchModal.test.js:11:11)
    at Promise.then.completed (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/testWorker.js:106:12)

Check warning on line 0 in UserSearchModal should render "UserSearchContainer"

See this annotation in the file changed.

@github-actions github-actions / Jest Unit Test Results

UserSearchModal should render "UserSearchContainer" (UserSearchModal should render "UserSearchContainer") failed

artifacts/jest-junit/junit.xml
Raw output
TestingLibraryElementError: Unable to find an element with the text: UserSearchContainer. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body />
    at Object.getElementError (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByText (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/src/UserSearchModal.test.js:17:19)
    at Promise.then.completed (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/testWorker.js:106:12)

Check warning on line 0 in UserSearchModal close modal on clicking close button

See this annotation in the file changed.

@github-actions github-actions / Jest Unit Test Results

UserSearchModal close modal on clicking close button (UserSearchModal close modal on clicking close button) failed

artifacts/jest-junit/junit.xml
Raw output
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name "Dismiss modal"

There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the `hidden` option to `true`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole

Ignored nodes: comments, script, style
<body />
    at Object.getElementError (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByRole (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/src/UserSearchModal.test.js:21:27)
    at Promise.then.completed (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/ui-plugin-find-user/ui-plugin-find-user/node_modules/jest-runner/build/testWorker.js:106:12)