Merge branch 'main' into 13764-support-link-a-sub-form-to-data-model #19510
frontend-unit-tests.yml
on: push
CodeQL
5m 38s
Typechecking and linting
2m 17s
Testing
10m 41s
Annotations
3 errors
useCreateSubform › should call addLayoutSet with correct parameters:
frontend/packages/shared/src/contexts/ServicesContext.tsx#L130
useServicesContext must be used within a ServicesContextProvider.
at useServicesContext (packages/shared/src/contexts/ServicesContext.tsx:130:11)
at useCreateDataModelMutation (app-development/hooks/mutations/useCreateDataModelMutation.ts:13:49)
at useCreateSubform (packages/ux-editor/src/hooks/useCreateSubform.ts:25:31)
at packages/ux-editor/src/hooks/useCreateSubform.test.ts:18:64
at TestComponent (../node_modules/@testing-library/react/dist/pure.js:334:27)
at renderWithHooks (../node_modules/react-dom/cjs/react-dom.development.js:2656:157)
at mountIndeterminateComponent (../node_modules/react-dom/cjs/react-dom.development.js:3301:1445)
at beginWork (../node_modules/react-dom/cjs/react-dom.development.js:3640:93)
at beginWork$1 (../node_modules/react-dom/cjs/react-dom.development.js:4696:93)
at performUnitOfWork (../node_modules/react-dom/cjs/react-dom.development.js:4522:270)
at workLoopSync (../node_modules/react-dom/cjs/react-dom.development.js:4508:30)
at renderRootSync (../node_modules/react-dom/cjs/react-dom.development.js:4504:159)
at recoverFromConcurrentError (../node_modules/react-dom/cjs/react-dom.development.js:4383:170)
at performConcurrentWorkOnRoot (../node_modules/react-dom/cjs/react-dom.development.js:4347:126)
at flushActQueue (../node_modules/react/cjs/react.development.js:2337:28)
at act (../node_modules/react/cjs/react.development.js:2261:15)
at ../node_modules/@testing-library/react/dist/act-compat.js:70:25
at renderRoot (../node_modules/@testing-library/react/dist/pure.js:204:26)
at render (../node_modules/@testing-library/react/dist/pure.js:296:10)
at renderHook (../node_modules/@testing-library/react/dist/pure.js:343:7)
at Object.<anonymous> (packages/ux-editor/src/hooks/useCreateSubform.test.ts:18:41)
|
useCreateSubform › should call addLayoutSet with correct parameters:
frontend/packages/ux-editor/src/hooks/useCreateSubform.test.ts#L18
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: useServicesContext must be used within a ServicesContextProvider.]
at reportException (../node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:66:24)
at innerInvokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:353:9)
at invokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
at HTMLUnknownElementImpl._dispatch (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
at HTMLUnknownElementImpl.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
at HTMLUnknownElement.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
at Object.invokeGuardedCallbackDev (../node_modules/react-dom/cjs/react-dom.development.js:750:45)
at invokeGuardedCallback (../node_modules/react-dom/cjs/react-dom.development.js:771:126)
at beginWork$1 (../node_modules/react-dom/cjs/react-dom.development.js:4706:1)
at performUnitOfWork (../node_modules/react-dom/cjs/react-dom.development.js:4522:270)
at workLoopSync (../node_modules/react-dom/cjs/react-dom.development.js:4508:30)
at renderRootSync (../node_modules/react-dom/cjs/react-dom.development.js:4504:159)
at performConcurrentWorkOnRoot (../node_modules/react-dom/cjs/react-dom.development.js:4343:166)
at flushActQueue (../node_modules/react/cjs/react.development.js:2337:28)
at act (../node_modules/react/cjs/react.development.js:2261:15)
at ../node_modules/@testing-library/react/dist/act-compat.js:70:25
at renderRoot (../node_modules/@testing-library/react/dist/pure.js:204:26)
at render (../node_modules/@testing-library/react/dist/pure.js:296:10)
at renderHook (../node_modules/@testing-library/react/dist/pure.js:343:7)
at Object.<anonymous> (packages/ux-editor/src/hooks/useCreateSubform.test.ts:18:41)
detail: Error: useServicesContext must be used within a ServicesContextProvider.
at useServicesContext (packages/shared/src/contexts/ServicesContext.tsx:130:11)
at useCreateDataModelMutation (app-development/hooks/mutations/useCreateDataModelMutation.ts:13:49)
at useCreateSubform (packages/ux-editor/src/hooks/useCreateSubform.ts:25:31)
at packages/ux-editor/src/hooks/useCreateSubform.test.ts:18:64
at TestComponent (../node_modules/@testing-library/react/dist/pure.js:334:27)
at renderWithHooks (../node_modules/react-dom/cjs/react-dom.development.js:2656:157)
at mountIndeterminateComponent (../node_modules/react-dom/cjs/react-dom.development.js:3301:1445)
at beginWork (../node_modules/react-dom/cjs/react-dom.development.js:3640:93)
at HTMLUnknownElement.callCallback (../node_modules/react-dom/cjs/react-dom.development.js:730:119)
at HTMLUnknownElement.callTheUserObjectsOperation (../node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
at innerInvokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:350:25)
at invokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
at HTMLUnknownElementImpl._dispatch (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
at HTMLUnknownElementImpl.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
at HTMLUnknownElement.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
at Object.invokeGuardedCallbackDev (../node_modules/react-dom/cjs/react-dom.development.js:750:45)
at invokeGuardedCallback (../node_modules/react-dom/cjs/react-dom.development.js:771:126)
at beginWork$1 (../node_modules/react-dom/cjs/react-dom.development.js:4706:1)
at performUnitOfWork (../node_modules/react-dom/cjs/react-dom.development.js:4
|
Testing
Process completed with exit code 1.
|