Update data model selection in component config #15541
frontend-unit-tests.yml
on: pull_request
CodeQL
4m 38s
Typechecking and linting
1m 16s
Testing
2m 18s
Annotations
12 errors
Typechecking and linting:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.test.tsx#L11
Cannot find module 'app-shared/utils/webStorage' or its corresponding type declarations.
|
Typechecking and linting:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx#L4
Module '"@digdir/design-system-react"' has no exported member 'Fieldset'.
|
Typechecking and linting
Process completed with exit code 2.
|
DataModelBindings › checks that handleComponentChange is called:
frontend/packages/ux-editor/src/components/Properties/DataModelBindings.test.tsx#L291
TestingLibraryElementError: Unable to find an accessible element with the role "combobox" and name "[mockedText(ux_editor.modal_properties_data_model_field_binding)]"
Here are the accessible roles:
img:
Name "Feil":
<svg
aria-labelledby="title-r20"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="fds-paragraph fds-paragraph--md"
/>
--------------------------------------------------
button:
Name "[mockedText(general.try_again)]":
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<div
class=""
>
<div
class="fds-alert fds-alert--md fds-alert--danger"
>
<svg
aria-labelledby="title-r20"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<title
id="title-r20"
>
Feil
</title>
<path
clip-rule="evenodd"
d="M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53L7.742 2.47Zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94 9.03 7.97Z"
fill="currentColor"
fill-rule="evenodd"
/>
</svg>
<span
class="fds-paragraph fds-paragraph--md fds-alert__content"
>
<p
class="fds-paragraph fds-paragraph--md"
>
[mockedText(general.error_message)]
</p>
<div
class=""
>
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
>
[mockedText(general.try_again)]
</button>
</div>
</span>
</div>
</div>
</div>
</body>
at Object.getElementError (../node_modules/@testing-library/dom/dist/config.js:37:19)
at ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at Object.getByRole (packages/ux-editor/src/components/Properties/DataModelBindings.test.tsx:291:43)
|
DataModelBindings › checks that handleComponentChange is called:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx#L32
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.
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `EditBinding`.
at bindingKey (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:32:3)
at div
at component (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.tsx:22:3)
at div
at div
at givenClass (libs/studio-components/src/components/StudioProperty/StudioPropertyGroup/StudioPropertyGroup.tsx:11:17)
at div
at DataModelBindings (packages/ux-editor/src/components/Properties/DataModelBindings.tsx:14:39)
at children (packages/shared/src/providers/PreviewConnectionContext.tsx:14:3)
at QueryClientProvider (../node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:30:3)
at ErrorBoundary (../node_modules/react-error-boundary/dist/react-error-boundary.cjs.js:16:5)
at children (packages/shared/src/contexts/ServicesContext.tsx:103:3)
at basenameProp (../node_modules/react-router/lib/components.tsx:413:13)
at basename (../node_modules/react-router/lib/components.tsx:219:3)
at children (packages/ux-editor/src/testing/mocks.tsx:85:19)
at console.captureMessage [as error] (/home/runner/work/altinn-studio/altinn-studio/node_modules/jest-fail-on-console/index.js:83:25)
at printWarning (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:209:30)
at error (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:183:7)
at Object.createElementWithValidation [as createElement] (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2354:7)
at createElement (/home/runner/work/altinn-studio/altinn-studio/frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:78:5)
at renderWithHooks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:15486:18)
at mountIndeterminateComponent (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:20103:13)
at beginWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:21626:16)
at beginWork$1 (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:27465:14)
at performUnitOfWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26599:12)
at workLoopSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26505:5)
at renderRootSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26473:7)
at performSyncWorkOnRoot (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26124:20)
at flushSyncCallbacks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:12042:22)
at flushActQueue (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2667:24)
at act (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2582:11)
at /home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/act-compat.js:47:25
at Object.eventWrapper (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/pure.js:107:28)
at Object.wrapEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-librar
|
EditDataModelBinding › should render EditBinding when undefinedBinding is clicked:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx#L50
TestingLibraryElementError: Unable to find an accessible element with the role "combobox" and name "[mockedText(ux_editor.modal_properties_data_model_field_binding)]"
Here are the accessible roles:
img:
Name "Feil":
<svg
aria-labelledby="title-r4"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="fds-paragraph fds-paragraph--md"
/>
--------------------------------------------------
button:
Name "[mockedText(general.try_again)]":
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<div
class=""
>
<div
class="fds-alert fds-alert--md fds-alert--danger"
>
<svg
aria-labelledby="title-r4"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<title
id="title-r4"
>
Feil
</title>
<path
clip-rule="evenodd"
d="M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53L7.742 2.47Zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94 9.03 7.97Z"
fill="currentColor"
fill-rule="evenodd"
/>
</svg>
<span
class="fds-paragraph fds-paragraph--md fds-alert__content"
>
<p
class="fds-paragraph fds-paragraph--md"
>
[mockedText(general.error_message)]
</p>
<div
class=""
>
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
>
[mockedText(general.try_again)]
</button>
</div>
</span>
</div>
</div>
</div>
</body>
at Object.getElementError (../node_modules/@testing-library/dom/dist/config.js:37:19)
at ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at getByRole (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:50:43)
at Object.<anonymous> (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:88:5)
|
EditDataModelBinding › should render EditBinding when undefinedBinding is clicked:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx#L32
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.
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `EditBinding`.
at bindingKey (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:32:3)
at div
at component (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.tsx:22:3)
at children (packages/shared/src/providers/PreviewConnectionContext.tsx:14:3)
at QueryClientProvider (../node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:30:3)
at ErrorBoundary (../node_modules/react-error-boundary/dist/react-error-boundary.cjs.js:16:5)
at children (packages/shared/src/contexts/ServicesContext.tsx:103:3)
at basenameProp (../node_modules/react-router/lib/components.tsx:413:13)
at basename (../node_modules/react-router/lib/components.tsx:219:3)
at children (packages/ux-editor/src/testing/mocks.tsx:85:19)
at console.captureMessage [as error] (/home/runner/work/altinn-studio/altinn-studio/node_modules/jest-fail-on-console/index.js:83:25)
at printWarning (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:209:30)
at error (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:183:7)
at Object.createElementWithValidation [as createElement] (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2354:7)
at createElement (/home/runner/work/altinn-studio/altinn-studio/frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:78:5)
at renderWithHooks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:15486:18)
at mountIndeterminateComponent (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:20103:13)
at beginWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:21626:16)
at beginWork$1 (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:27465:14)
at performUnitOfWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26599:12)
at workLoopSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26505:5)
at renderRootSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26473:7)
at performSyncWorkOnRoot (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26124:20)
at flushSyncCallbacks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:12042:22)
at flushActQueue (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2667:24)
at act (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2582:11)
at /home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/act-compat.js:47:25
at Object.eventWrapper (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/pure.js:107:28)
at Object.wrapEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/wrapEvent.js:6:28)
at Object.dispatchEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:45:22)
at Object.dispatchUIEvent (/home/runner/work/altin
|
EditDataModelBinding › should close EditBinding when click on close button:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx#L50
TestingLibraryElementError: Unable to find an accessible element with the role "combobox" and name "[mockedText(ux_editor.modal_properties_data_model_field_binding)]"
Here are the accessible roles:
img:
Name "Feil":
<svg
aria-labelledby="title-r7"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="fds-paragraph fds-paragraph--md"
/>
--------------------------------------------------
button:
Name "[mockedText(general.try_again)]":
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<div
class=""
>
<div
class="fds-alert fds-alert--md fds-alert--danger"
>
<svg
aria-labelledby="title-r7"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<title
id="title-r7"
>
Feil
</title>
<path
clip-rule="evenodd"
d="M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53L7.742 2.47Zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94 9.03 7.97Z"
fill="currentColor"
fill-rule="evenodd"
/>
</svg>
<span
class="fds-paragraph fds-paragraph--md fds-alert__content"
>
<p
class="fds-paragraph fds-paragraph--md"
>
[mockedText(general.error_message)]
</p>
<div
class=""
>
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
>
[mockedText(general.try_again)]
</button>
</div>
</span>
</div>
</div>
</div>
</body>
at Object.getElementError (../node_modules/@testing-library/dom/dist/config.js:37:19)
at ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at getByRole (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:50:43)
at Object.<anonymous> (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:97:5)
|
EditDataModelBinding › should close EditBinding when click on close button:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx#L32
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.
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `EditBinding`.
at bindingKey (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:32:3)
at div
at component (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.tsx:22:3)
at children (packages/shared/src/providers/PreviewConnectionContext.tsx:14:3)
at QueryClientProvider (../node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:30:3)
at ErrorBoundary (../node_modules/react-error-boundary/dist/react-error-boundary.cjs.js:16:5)
at children (packages/shared/src/contexts/ServicesContext.tsx:103:3)
at basenameProp (../node_modules/react-router/lib/components.tsx:413:13)
at basename (../node_modules/react-router/lib/components.tsx:219:3)
at children (packages/ux-editor/src/testing/mocks.tsx:85:19)
at console.captureMessage [as error] (/home/runner/work/altinn-studio/altinn-studio/node_modules/jest-fail-on-console/index.js:83:25)
at printWarning (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:209:30)
at error (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:183:7)
at Object.createElementWithValidation [as createElement] (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2354:7)
at createElement (/home/runner/work/altinn-studio/altinn-studio/frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:78:5)
at renderWithHooks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:15486:18)
at mountIndeterminateComponent (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:20103:13)
at beginWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:21626:16)
at beginWork$1 (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:27465:14)
at performUnitOfWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26599:12)
at workLoopSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26505:5)
at renderRootSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26473:7)
at performSyncWorkOnRoot (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26124:20)
at flushSyncCallbacks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:12042:22)
at flushActQueue (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2667:24)
at act (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2582:11)
at /home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/act-compat.js:47:25
at Object.eventWrapper (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/pure.js:107:28)
at Object.wrapEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/wrapEvent.js:6:28)
at Object.dispatchEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:45:22)
at Object.dispatchUIEvent (/home/runner/work/altin
|
EditDataModelBinding › should remove binding when click on delete button in EditBinding:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx#L50
TestingLibraryElementError: Unable to find an accessible element with the role "combobox" and name "[mockedText(ux_editor.modal_properties_data_model_field_binding)]"
Here are the accessible roles:
img:
Name "Feil":
<svg
aria-labelledby="title-rf"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="fds-paragraph fds-paragraph--md"
/>
--------------------------------------------------
button:
Name "[mockedText(general.try_again)]":
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<div
class=""
>
<div
class="fds-alert fds-alert--md fds-alert--danger"
>
<svg
aria-labelledby="title-rf"
class="fds-alert__icon"
fill="none"
focusable="false"
height="1em"
role="img"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<title
id="title-rf"
>
Feil
</title>
<path
clip-rule="evenodd"
d="M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53L7.742 2.47Zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94 9.03 7.97Z"
fill="currentColor"
fill-rule="evenodd"
/>
</svg>
<span
class="fds-paragraph fds-paragraph--md fds-alert__content"
>
<p
class="fds-paragraph fds-paragraph--md"
>
[mockedText(general.error_message)]
</p>
<div
class=""
>
<button
class="fds-btn fds-focus fds-btn--sm fds-btn--primary fds-btn--first undefined"
type="button"
>
[mockedText(general.try_again)]
</button>
</div>
</span>
</div>
</div>
</div>
</body>
at Object.getElementError (../node_modules/@testing-library/dom/dist/config.js:37:19)
at ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at getByRole (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:50:43)
at Object.<anonymous> (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.test.tsx:172:5)
|
EditDataModelBinding › should remove binding when click on delete button in EditBinding:
frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx#L32
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.
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `EditBinding`.
at bindingKey (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:32:3)
at div
at component (packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditDataModelBinding.tsx:22:3)
at children (packages/shared/src/providers/PreviewConnectionContext.tsx:14:3)
at QueryClientProvider (../node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:30:3)
at ErrorBoundary (../node_modules/react-error-boundary/dist/react-error-boundary.cjs.js:16:5)
at children (packages/shared/src/contexts/ServicesContext.tsx:103:3)
at basenameProp (../node_modules/react-router/lib/components.tsx:413:13)
at basename (../node_modules/react-router/lib/components.tsx:219:3)
at children (packages/ux-editor/src/testing/mocks.tsx:85:19)
at console.captureMessage [as error] (/home/runner/work/altinn-studio/altinn-studio/node_modules/jest-fail-on-console/index.js:83:25)
at printWarning (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:209:30)
at error (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:183:7)
at Object.createElementWithValidation [as createElement] (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2354:7)
at createElement (/home/runner/work/altinn-studio/altinn-studio/frontend/packages/ux-editor/src/components/config/editModal/EditDataModelBinding/EditBinding/EditBinding.tsx:78:5)
at renderWithHooks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:15486:18)
at mountIndeterminateComponent (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:20103:13)
at beginWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:21626:16)
at beginWork$1 (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:27465:14)
at performUnitOfWork (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26599:12)
at workLoopSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26505:5)
at renderRootSync (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26473:7)
at performSyncWorkOnRoot (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:26124:20)
at flushSyncCallbacks (/home/runner/work/altinn-studio/altinn-studio/node_modules/react-dom/cjs/react-dom.development.js:12042:22)
at flushActQueue (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2667:24)
at act (/home/runner/work/altinn-studio/altinn-studio/node_modules/react/cjs/react.development.js:2582:11)
at /home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/act-compat.js:47:25
at Object.eventWrapper (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/react/dist/pure.js:107:28)
at Object.wrapEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/wrapEvent.js:6:28)
at Object.dispatchEvent (/home/runner/work/altinn-studio/altinn-studio/node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:45:22)
at Object.dispatchUIEvent (/home/runner/work/altin
|
Testing
Process completed with exit code 1.
|