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

feat(widget-builder): Add limit field to widget builder hook #81944

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

nikkikapadia
Copy link
Member

Added the limit field to widget builder hook and made test. I put it as a number and use a deserializer to go from query param string to number. Let me know if there was a different way you were thinking of doing it.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 10, 2024
@nikkikapadia nikkikapadia marked this pull request as ready for review December 10, 2024 22:05
@nikkikapadia nikkikapadia requested a review from a team as a code owner December 10, 2024 22:05
Copy link

codecov bot commented Dec 11, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
8354 1 8353 0
View the top 1 failed tests by shortest run time
useWidgetBuilderState limit can decode and update limit
Stack Traces | 0.033s run time
Error: Expected test not to call console.error().

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.

Error: Uncaught [Error: useUrlBatchContext must be used within a UrlParamBatchProvider]
    at reportException (.../living/helpers/runtime-script-errors.js:66:24)
    at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:353:9)
    at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
    at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
    at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
    at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
    at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
    at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
    at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
    at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
    at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
    at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
    at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25738:74)
    at flushActQueue (.../react/cjs/react.development.js:2667:24)
    at act (.../react/cjs/react.development.js:2582:11)
    at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
    at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
    at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
    at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
    at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12) {
  detail: Error: useUrlBatchContext must be used within a UrlParamBatchProvider
      at useUrlBatchContext (.../widgetBuilder/contexts/urlParamBatchContext.tsx:63:11)
      at useQueryParamState (.../widgetBuilder/hooks/useQueryParamState.tsx:31:52)
      at useWidgetBuilderState (.../widgetBuilder/hooks/useWidgetBuilderState.tsx:25:72)
      at .../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:89
      at TestComponent (.../sentry/sentry/node_modules/@.../react/dist/pure.js:309:27)
      at renderWithHooks (.../react-dom/cjs/react-dom.development.js:16305:18)
      at mountIndeterminateComponent (.../react-dom/cjs/react-dom.development.js:20074:13)
      at beginWork (.../react-dom/cjs/react-dom.development.js:21587:16)
      at HTMLUnknownElement.callCallback (.../react-dom/cjs/react-dom.development.js:4164:14)
      at HTMLUnknownElement.callTheUserObjectsOperation (.../sentry/sentry/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
      at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:350:25)
      at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
      at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
      at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
      at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
      at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
      at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
      at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
      at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
      at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
      at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
      at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25738:74)
      at flushActQueue (.../react/cjs/react.development.js:2667:24)
      at act (.../react/cjs/react.development.js:2582:11)
      at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
      at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
      at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
      at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
      at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
      at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
      at new Promise (<anonymous>)
      at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
      at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
      at processTicksAndRejections (node:internal/process/task_queues:105:5)
      at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
      at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
      at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
      at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
      at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
      at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
      at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12),
  type: 'unhandled exception'
}
    at console.captureMessage [as error] (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:83:25)
    at VirtualConsole.<anonymous> (.../sentry/sentry/node_modules/jest-environment-jsdom/build/index.js:63:23)
    at VirtualConsole.emit (node:events:518:28)
    at reportException (.../living/helpers/runtime-script-errors.js:70:28)
    at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:353:9)
    at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
    at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
    at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
    at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
    at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
    at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
    at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
    at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
    at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
    at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
    at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25738:74)
    at flushActQueue (.../react/cjs/react.development.js:2667:24)
    at act (.../react/cjs/react.development.js:2582:11)
    at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
    at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
    at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
    at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
    at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)

Error: Uncaught [Error: useUrlBatchContext must be used within a UrlParamBatchProvider]
    at reportException (.../living/helpers/runtime-script-errors.js:66:24)
    at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:353:9)
    at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
    at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
    at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
    at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
    at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
    at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
    at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
    at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
    at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
    at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
    at recoverFromConcurrentError (.../react-dom/cjs/react-dom.development.js:25850:20)
    at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25750:22)
    at flushActQueue (.../react/cjs/react.development.js:2667:24)
    at act (.../react/cjs/react.development.js:2582:11)
    at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
    at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
    at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
    at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
    at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12) {
  detail: Error: useUrlBatchContext must be used within a UrlParamBatchProvider
      at useUrlBatchContext (.../widgetBuilder/contexts/urlParamBatchContext.tsx:63:11)
      at useQueryParamState (.../widgetBuilder/hooks/useQueryParamState.tsx:31:52)
      at useWidgetBuilderState (.../widgetBuilder/hooks/useWidgetBuilderState.tsx:25:72)
      at .../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:89
      at TestComponent (.../sentry/sentry/node_modules/@.../react/dist/pure.js:309:27)
      at renderWithHooks (.../react-dom/cjs/react-dom.development.js:16305:18)
      at mountIndeterminateComponent (.../react-dom/cjs/react-dom.development.js:20074:13)
      at beginWork (.../react-dom/cjs/react-dom.development.js:21587:16)
      at HTMLUnknownElement.callCallback (.../react-dom/cjs/react-dom.development.js:4164:14)
      at HTMLUnknownElement.callTheUserObjectsOperation (.../sentry/sentry/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
      at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:350:25)
      at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
      at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
      at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
      at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
      at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
      at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
      at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
      at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
      at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
      at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
      at recoverFromConcurrentError (.../react-dom/cjs/react-dom.development.js:25850:20)
      at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25750:22)
      at flushActQueue (.../react/cjs/react.development.js:2667:24)
      at act (.../react/cjs/react.development.js:2582:11)
      at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
      at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
      at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
      at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
      at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
      at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
      at new Promise (<anonymous>)
      at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
      at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
      at processTicksAndRejections (node:internal/process/task_queues:105:5)
      at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
      at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
      at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
      at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
      at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
      at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
      at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
      at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12),
  type: 'unhandled exception'
}
    at console.captureMessage [as error] (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:83:25)
    at VirtualConsole.<anonymous> (.../sentry/sentry/node_modules/jest-environment-jsdom/build/index.js:63:23)
    at VirtualConsole.emit (node:events:518:28)
    at reportException (.../living/helpers/runtime-script-errors.js:70:28)
    at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:353:9)
    at invokeEventListeners (.../living/events/EventTarget-impl.js:286:3)
    at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:233:9)
    at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:104:17)
    at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:241:34)
    at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:4213:16)
    at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4277:31)
    at beginWork$1 (.../react-dom/cjs/react-dom.development.js:27451:7)
    at performUnitOfWork (.../react-dom/cjs/react-dom.development.js:26560:12)
    at workLoopSync (.../react-dom/cjs/react-dom.development.js:26466:5)
    at renderRootSync (.../react-dom/cjs/react-dom.development.js:26434:7)
    at recoverFromConcurrentError (.../react-dom/cjs/react-dom.development.js:25850:20)
    at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25750:22)
    at flushActQueue (.../react/cjs/react.development.js:2667:24)
    at act (.../react/cjs/react.development.js:2582:11)
    at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
    at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
    at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
    at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
    at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)

The above error occurred in the <TestComponent> component:

    at TestComponent (.../sentry/sentry/node_modules/@.../react/dist/pure.js:307:5)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
    at console.captureMessage [as error] (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:83:25)
    at logCapturedError (.../react-dom/cjs/react-dom.development.js:18687:23)
    at update.callback (.../react-dom/cjs/react-dom.development.js:18720:5)
    at callCallback (.../react-dom/cjs/react-dom.development.js:13923:12)
    at commitUpdateQueue (.../react-dom/cjs/react-dom.development.js:13944:9)
    at commitLayoutEffectOnFiber (.../react-dom/cjs/react-dom.development.js:23391:13)
    at commitLayoutMountEffects_complete (.../react-dom/cjs/react-dom.development.js:24688:9)
    at commitLayoutEffects_begin (.../react-dom/cjs/react-dom.development.js:24674:7)
    at commitLayoutEffects (.../react-dom/cjs/react-dom.development.js:24612:3)
    at commitRootImpl (.../react-dom/cjs/react-dom.development.js:26823:5)
    at commitRoot (.../react-dom/cjs/react-dom.development.js:26682:5)
    at finishConcurrentRender (.../react-dom/cjs/react-dom.development.js:25892:9)
    at performConcurrentWorkOnRoot (.../react-dom/cjs/react-dom.development.js:25809:7)
    at flushActQueue (.../react/cjs/react.development.js:2667:24)
    at act (.../react/cjs/react.development.js:2582:11)
    at .../sentry/sentry/node_modules/@.../react/dist/act-compat.js:47:25
    at renderRoot (.../sentry/sentry/node_modules/@.../react/dist/pure.js:180:26)
    at render (.../sentry/sentry/node_modules/@.../react/dist/pure.js:271:10)
    at renderHook (.../sentry/sentry/node_modules/@.../react/dist/pure.js:318:7)
    at Object.<anonymous> (.../widgetBuilder/hooks/useWidgetBuilderState.spec.tsx:280:47)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)
    at flushUnexpectedConsoleCalls (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:48:13)
    at Object.<anonymous> (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:139:7)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusHook (.../sentry/sentry/node_modules/jest-circus/build/run.js:281:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:254:5)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Member

@narsaynorath narsaynorath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment on fixing the test failure but lgtm. Ideally we'd pass along the decodeInteger to the decoder, but it seems like it wouldn't handle the default properly so this is okay for now.

})
);

const {result} = renderHook(() => useWidgetBuilderState());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is failing because you need to add a second argument to render hook since now I'm tying it to the URL batch thing.

Suggested change
const {result} = renderHook(() => useWidgetBuilderState());
const {result} = renderHook(() => useWidgetBuilderState(), {wrapper: <whatever I called the provider>});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup yup just added that in

@nikkikapadia nikkikapadia enabled auto-merge (squash) December 11, 2024 15:24
@nikkikapadia nikkikapadia merged commit f8dbf86 into master Dec 11, 2024
42 checks passed
@nikkikapadia nikkikapadia deleted the nikki/feat/widget-builder-limit branch December 11, 2024 15:35
Copy link

sentry-io bot commented Dec 18, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SyntaxError: Unexpected token 'c', "count()" is not valid JSON ?(useWidgetBuilderState.tsx) View Issue

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Jan 2, 2025
Added the limit field to widget builder hook and made test. I put it as
a number and use a deserializer to go from query param string to number.
Let me know if there was a different way you were thinking of doing it.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants