Skip to content

update addNewCodeListItem tests #21699

update addNewCodeListItem tests

update addNewCodeListItem tests #21699

Triggered via push February 14, 2025 13:51
Status Failure
Total duration 13m 16s
Artifacts
Fit to window
Zoom out
Zoom in

Annotations

12 errors
Typechecking and linting: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.tsx#L112
Argument of type 'TypeofResult' is not assignable to parameter of type 'CodeListItemValueLiteral | (() => CodeListItemValueLiteral)'.
Typechecking and linting
Process completed with exit code 2.
StudioCodeListEditor › Renders a message when the code list is empty: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L100
TestingLibraryElementError: Unable to find an element with the text: The code list is empty.. 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> <div> <fieldset class="fds-fieldset fds-fieldset--spacing codeListEditor" > <legend class="fds-label fds-label--sm fds-label--medium-weight fds-fieldset__legend" > <span class="fds-fieldset__legend__content" > Code list </span> </legend> <p class="fds-label fds-label--sm fds-label--medium-weight" for=":r3l:" > Velg hvilken type verdiene i kodelisten skal ha: </p> <div class="fds-paragraph fds-paragraph--sm fds-native-select--container" > <select class="fds-native-select fds-native-select--sm fds-focus" id=":r3m:" name=":r3l:" > <option value="string" > Tekst (anbefalt) </option> <option value="number" > Tall </option> <option value="boolean" > Boolsk </option> </select> </div> <button class="fds-btn fds-focus fds-btn--sm fds-btn--secondary fds-btn--first studioButton" type="button" > <span class="innerContainer" > <span aria-hidden="true" class="iconWrapper" > <svg fill="none" focusable="false" height="1em" role="img" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg" > <path d="M12.75 5.5a.75.75 0 0 0-1.5 0v5.75H5.5a.75.75 0 0 0 0 1.5h5.75v5.75a.75.75 0 0 0 1.5 0v-5.75h5.75a.75.75 0 0 0 0-1.5h-5.75z" fill="currentColor" /> </svg> </span> Add </span> </button> <div aria-live="polite" aria-relevant="additions removals" class="fds-fieldset__error-message" id="fieldset-error-:r3k:" /> </fieldset> </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.getByText (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:100:19)
StudioCodeListEditor › Type handling › Renders type selector when code list is empty: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L511
expect(received).toBeNull() Received: 1 at Object.toBeNull (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:511:17)
StudioCodeListEditor › Type handling › Creates an empty string item when 'text' is selected and 'Add new' is pressed: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L515
expect(received).toBeNull() Received: 1 at Object.toBeNull (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:515:17)
StudioCodeListEditor › Type handling › Creates an empty number item when 'number' is selected and 'Add new' is pressed: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L519
expect(received).toBeNull() Received: 1 at Object.toBeNull (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:519:17)
StudioCodeListEditor › Type handling › Creates an empty boolean item when 'boolean' is selected and 'Add new' is pressed: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L523
expect(received).toBeNull() Received: 1 at Object.toBeNull (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:523:17)
StudioCodeListEditor › Type handling › Added new items should be same type as previous item: frontend/libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx#L606
expect(received).toBeNull() Received: 1 at Object.toBeNull (libs/studio-components/src/components/StudioCodelistEditor/StudioCodeListEditor.test.tsx:606:17)
CreateNewCodeListModal › renders the code list editor without content: frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListsActionsBar/CreateNewCodeListModal/CreateNewCodeListModal.test.tsx#L36
TestingLibraryElementError: Unable to find an element with the text: [mockedText(code_list_editor.empty)]. 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 class="fds-modal--lock-scroll" > <div> <button aria-expanded="true" aria-haspopup="dialog" class="fds-btn fds-focus fds-btn--sm fds-btn--secondary fds-btn--first studioButton" type="button" > [mockedText(app_content_library.code_lists.create_new_code_list)] </button> <dialog class="fds-modal createNewCodeListModal dialog withContentPadding" open="" > <span data-floating-ui-focus-guard="" data-type="inside" role="button" style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;" tabindex="0" /> <div class="fds-modal__header heading" > <h2 class="fds-heading fds-heading--xs" > <span> [mockedText(app_content_library.code_lists.create_new_code_list_modal_title)] </span> </h2> <button class="fds-btn fds-focus fds-btn--md fds-btn--tertiary fds-btn--second fds-btn--icon-only fds-modal__header__button" name="close" type="button" > <svg aria-labelledby="title-rl" fill="none" focusable="false" font-size="1.5em" height="1em" role="img" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg" > <title id="title-rl" > close modal </title> <path d="M6.53 5.47a.75.75 0 0 0-1.06 1.06L10.94 12l-5.47 5.47a.75.75 0 1 0 1.06 1.06L12 13.06l5.47 5.47a.75.75 0 1 0 1.06-1.06L13.06 12l5.47-5.47a.75.75 0 0 0-1.06-1.06L12 10.94 6.53 5.47Z" fill="currentColor" /> </svg> </button> </div> <div class="fds-modal__content content" > <div class="createNewCodeList" > <div class="fds-paragraph fds-paragraph--sm fds-textfield fds-textfield--sm codeListTitle" > <label class="fds-label fds-label--sm fds-label--medium-weight fds-textfield__label" for="textfield-:rm:" > <span> <span class="studioLabelWrapper" > [mockedText(app_content_library.code_lists.create_new_code_list_name)] </span> </span> </label> <div class="fds-textfield__field" > <input class="fds-textfield__input fds-focus" id="textfield-:rm:" size="20" type="text" value="" /> </div> <div aria-live="polite" aria-relevant="additions removals" class="fds-textfield__error-message" id="textfield-error-:rm:" /> </div> <div class="codeListEditor" > <fieldset class="fds-fieldset fds-fieldset--spacing codeListEditor" > <legend class="fds-label fds-label--sm fds-label--medium-weight fds-fieldset__legend" > <span class="fds-fieldset__legend__content" > [mockedText(code_list_editor.legend)] </span> </legend> <p class="fds-label fds-label--sm fds-label--medium-weight" for=":rp:" > Velg hvilken type verdiene i kodelis
Testing
Process completed with exit code 1.