diff --git a/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js b/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js index 948b0079d2..2faca929cc 100644 --- a/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js +++ b/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js @@ -89,12 +89,12 @@ const CollapsiblesContent = styled.div` padding: 0.2em 0 0.2em 1em; `; -const DummyLink = styled.text` +const DummyLink = styled.span` color: ${colors.blue}; text-decoration: underline; `; -const MissingText = styled.text` +const MissingText = styled.span` font-weight: bold; background-color: ${colors.errorSecondary}; text-align: center; diff --git a/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/__snapshots__/index.test.js.snap b/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/__snapshots__/index.test.js.snap index c3817f40f0..de428b8405 100644 --- a/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/__snapshots__/index.test.js.snap @@ -110,6 +110,9 @@ exports[`Answer Editor should render Checkbox 1`] = ` "label": "", }, ], + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -240,6 +243,9 @@ exports[`Answer Editor should render Currency 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -371,6 +377,9 @@ exports[`Answer Editor should render Date 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -504,6 +513,9 @@ exports[`Answer Editor should render DateRange 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -633,6 +645,9 @@ exports[`Answer Editor should render Duration 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object { "unit": "YearsMonths", }, @@ -775,6 +790,9 @@ exports[`Answer Editor should render Mutually Exclusive 1`] = ` "label": "", }, ], + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -905,6 +923,9 @@ exports[`Answer Editor should render Number 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1036,6 +1057,9 @@ exports[`Answer Editor should render Percentage 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1174,6 +1198,9 @@ exports[`Answer Editor should render Radio 1`] = ` "label": "", }, ], + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1313,6 +1340,9 @@ exports[`Answer Editor should render Select 1`] = ` "label": "", }, ], + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1444,6 +1474,9 @@ exports[`Answer Editor should render TextArea 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1574,6 +1607,9 @@ exports[`Answer Editor should render TextField 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": "", @@ -1705,6 +1741,9 @@ exports[`Answer Editor should render Unit 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "1", + }, "properties": Object { "unit": "Centimetres", }, diff --git a/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/index.js b/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/index.js index 28e2e6ae8f..4330bfb7a3 100644 --- a/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/index.js +++ b/eq-author/src/App/page/Design/QuestionPageEditor/AnswersEditor/AnswerEditor/index.js @@ -139,7 +139,7 @@ class AnswerEditor extends React.Component { if (type === DATE_RANGE) { return ; } - // Only option left is Date as validation done in prop types + return ( { mockAnswer = { id: "1", title: "", + page: { id: "1" }, description: "", type: TEXTFIELD, guidance: "", diff --git a/eq-author/src/App/page/Design/QuestionPageEditor/QuestionProperties/AdditionalContentOptions.js b/eq-author/src/App/page/Design/QuestionPageEditor/QuestionProperties/AdditionalContentOptions.js index 1b413e2139..374d05a4fd 100644 --- a/eq-author/src/App/page/Design/QuestionPageEditor/QuestionProperties/AdditionalContentOptions.js +++ b/eq-author/src/App/page/Design/QuestionPageEditor/QuestionProperties/AdditionalContentOptions.js @@ -220,7 +220,7 @@ export const StatelessAdditionalInfo = ({ StatelessAdditionalInfo.propTypes = { onChange: PropTypes.func.isRequired, onUpdate: PropTypes.func.isRequired, - fetchAnswers: PropTypes.func.isRequired, + fetchAnswers: PropTypes.func, page: propType(pageFragment).isRequired, onChangeUpdate: PropTypes.func.isRequired, option: PropTypes.string.isRequired, diff --git a/eq-author/src/App/page/Design/answers/DateRange/__snapshots__/index.test.js.snap b/eq-author/src/App/page/Design/answers/DateRange/__snapshots__/index.test.js.snap index 8b6787e69c..f063ef2af0 100644 --- a/eq-author/src/App/page/Design/answers/DateRange/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/page/Design/answers/DateRange/__snapshots__/index.test.js.snap @@ -13,6 +13,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, @@ -42,6 +45,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, @@ -71,6 +77,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, @@ -94,6 +103,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, @@ -118,6 +130,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, @@ -140,6 +155,9 @@ exports[`DateRange should render 1`] = ` "guidance": "", "id": "1", "label": "", + "page": Object { + "id": "Page 1", + }, "properties": Object { "required": false, }, diff --git a/eq-author/src/App/page/Design/answers/DateRange/index.test.js b/eq-author/src/App/page/Design/answers/DateRange/index.test.js index a3580c24d1..173fb8e175 100644 --- a/eq-author/src/App/page/Design/answers/DateRange/index.test.js +++ b/eq-author/src/App/page/Design/answers/DateRange/index.test.js @@ -22,6 +22,9 @@ describe("DateRange", () => { id: "1", label: "", type: "DateRange", + page: { + id: "Page 1", + }, description: "test", guidance: "", secondaryLabel: "", diff --git a/eq-author/src/App/page/Design/answers/DateSingle/__snapshots__/index.test.js.snap b/eq-author/src/App/page/Design/answers/DateSingle/__snapshots__/index.test.js.snap index cb76f7775b..41e270389c 100644 --- a/eq-author/src/App/page/Design/answers/DateSingle/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/page/Design/answers/DateSingle/__snapshots__/index.test.js.snap @@ -17,6 +17,9 @@ exports[`Date should render 1`] = ` "mutuallyExclusive": false, }, ], + "page": Object { + "id": "Page 1", + }, "properties": Object {}, "qCode": "", "secondaryLabel": null, diff --git a/eq-author/src/App/page/Design/answers/DateSingle/index.test.js b/eq-author/src/App/page/Design/answers/DateSingle/index.test.js index 161fdf49b5..a6d6318353 100644 --- a/eq-author/src/App/page/Design/answers/DateSingle/index.test.js +++ b/eq-author/src/App/page/Design/answers/DateSingle/index.test.js @@ -24,6 +24,9 @@ describe("Date", () => { answer = { id: "ansID1", title: "Date title", + page: { + id: "Page 1", + }, description: "date description", label: "", type: "Date", diff --git a/eq-author/src/App/page/Logic/BinaryExpressionEditor/index.js b/eq-author/src/App/page/Logic/BinaryExpressionEditor/index.js index e7de84795e..985cba9a75 100644 --- a/eq-author/src/App/page/Logic/BinaryExpressionEditor/index.js +++ b/eq-author/src/App/page/Logic/BinaryExpressionEditor/index.js @@ -191,9 +191,10 @@ export const UnwrappedBinaryExpressionEditor = ({ const MetadataEditor = METADATA_TYPE_TO_RIGHT_EDITOR[expression?.left?.metadataType]; - const shouldRenderEditor = + const shouldRenderEditor = Boolean( (AnswerEditor && !expression.left.reason && !answerPickerError) || - MetadataEditor; + MetadataEditor + ); const isLastExpression = expressionIndex === expressionGroup.expressions.length - 1; diff --git a/eq-author/src/App/page/Preview/QuestionPagePreview.test.js b/eq-author/src/App/page/Preview/QuestionPagePreview.test.js index 831ed0529a..0fbf76a778 100644 --- a/eq-author/src/App/page/Preview/QuestionPagePreview.test.js +++ b/eq-author/src/App/page/Preview/QuestionPagePreview.test.js @@ -45,6 +45,9 @@ describe("QuestionPagePreview", () => { additionalInfoLabel: "

Additional Info Label

", additionalInfoContent: "

Additional Info Content

", additionalInfoEnabled: true, + confirmation: { + id: "confirmation-1", + }, validationErrorInfo: { totalCount: 0, errors: [] }, answers: [{ id: "1", type: TEXTFIELD }], comments: [], diff --git a/eq-author/src/App/page/Preview/index.test.js b/eq-author/src/App/page/Preview/index.test.js index 14d137d74f..ccc5c1e659 100644 --- a/eq-author/src/App/page/Preview/index.test.js +++ b/eq-author/src/App/page/Preview/index.test.js @@ -39,6 +39,9 @@ describe("page previews", () => { additionalInfoLabel: "

Additional Info Label

", additionalInfoContent: "

Additional Info Content

", additionalInfoEnabled: true, + confirmation: { + id: "confirmation-1", + }, validationErrorInfo: [], comments: [], answers: [], diff --git a/eq-author/src/App/qcodes/QCodesTable/index.js b/eq-author/src/App/qcodes/QCodesTable/index.js index ab57c0a305..caf84bed32 100644 --- a/eq-author/src/App/qcodes/QCodesTable/index.js +++ b/eq-author/src/App/qcodes/QCodesTable/index.js @@ -197,7 +197,7 @@ const Row = memo((props) => { data-test={`${id}${secondary ? "-secondary" : ""}${ listAnswerType === DRIVING ? "-driving" : "" }${listAnswerType === ANOTHER ? "-another" : ""}-test-input`} - value={qCode} + value={qCode || ""} // Ensure the input always has a value (empty string if qCode is null or undefined) onChange={(e) => setQcode(e.value)} onBlur={() => handleBlur(qCode)} hasError={Boolean(errorMessage)} @@ -271,7 +271,7 @@ export const QCodeTable = () => { (dataVersion === "3" || item.type !== "CheckboxOption") ) { return ( - <> + { {...item.additionalAnswer} errorMessage={getErrorMessage(item.additionalAnswer.qCode)} /> - + ); } else { return ( diff --git a/eq-author/src/App/questionConfirmation/Design/Editor.test.js b/eq-author/src/App/questionConfirmation/Design/Editor.test.js index ef538bd8a5..b5f792c91d 100644 --- a/eq-author/src/App/questionConfirmation/Design/Editor.test.js +++ b/eq-author/src/App/questionConfirmation/Design/Editor.test.js @@ -18,6 +18,7 @@ describe("Editor", () => { displayName: "My question", answers: [], }, + pageDescription: "Page description 1", positive: { id: "1", label: "Positive label", diff --git a/eq-author/src/App/questionConfirmation/Design/__snapshots__/Editor.test.js.snap b/eq-author/src/App/questionConfirmation/Design/__snapshots__/Editor.test.js.snap index ac6e5068f1..83672dd5be 100644 --- a/eq-author/src/App/questionConfirmation/Design/__snapshots__/Editor.test.js.snap +++ b/eq-author/src/App/questionConfirmation/Design/__snapshots__/Editor.test.js.snap @@ -27,6 +27,7 @@ exports[`Editor Editor Component should autoFocus the title when there is not on marginless={true} onChange={[MockFunction]} onUpdate={[MockFunction]} + pageDescription="Page description 1" /> @@ -108,6 +109,7 @@ exports[`Editor Editor Component should render 1`] = ` marginless={true} onChange={[MockFunction]} onUpdate={[MockFunction]} + pageDescription="Page description 1" /> diff --git a/eq-author/src/App/questionConfirmation/Design/__snapshots__/index.test.js.snap b/eq-author/src/App/questionConfirmation/Design/__snapshots__/index.test.js.snap index b6d9932b9a..74f6f7c9d5 100644 --- a/eq-author/src/App/questionConfirmation/Design/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/questionConfirmation/Design/__snapshots__/index.test.js.snap @@ -45,6 +45,7 @@ exports[`QuestionConfirmationRoute should render 1`] = ` "displayName": "My question", "id": "1", }, + "pageDescription": "Page description 1", "positive": Object { "description": "Positive description", "id": "1", diff --git a/eq-author/src/App/questionConfirmation/Design/index.test.js b/eq-author/src/App/questionConfirmation/Design/index.test.js index 947632faf1..e312204a42 100644 --- a/eq-author/src/App/questionConfirmation/Design/index.test.js +++ b/eq-author/src/App/questionConfirmation/Design/index.test.js @@ -19,6 +19,7 @@ describe("QuestionConfirmationRoute", () => { id: "1", displayName: "My first displayname", title: "My first confirmation", + pageDescription: "Page description 1", qCode: "", page: { id: "1", diff --git a/eq-author/src/App/questionConfirmation/Preview/index.test.js b/eq-author/src/App/questionConfirmation/Preview/index.test.js index 7adb8bc62f..76145294bf 100644 --- a/eq-author/src/App/questionConfirmation/Preview/index.test.js +++ b/eq-author/src/App/questionConfirmation/Preview/index.test.js @@ -11,6 +11,7 @@ describe("Question Confirmation Preview", () => { id: "1", displayName: "Hello world", title: "

Hello world

", + pageDescription: "Page description 1", qCode: "", positive: { id: "1", diff --git a/eq-author/src/App/section/Design/SectionEditor/SectionEditor.test.js b/eq-author/src/App/section/Design/SectionEditor/SectionEditor.test.js index 2a8bae98bb..c4bb6f9237 100644 --- a/eq-author/src/App/section/Design/SectionEditor/SectionEditor.test.js +++ b/eq-author/src/App/section/Design/SectionEditor/SectionEditor.test.js @@ -30,13 +30,14 @@ describe("SectionEditor", () => { id: "section-1", title: "Section 1", alias: "alias", + introductionEnabled: true, introductionTitle: "Intro title", introductionContent: "Intro content", introductionPageDescription: "Intro description", requiredCompleted: true, showOnHub: true, sectionSummary: false, - sectionSummaryPageDescription: "Summary description", + sectionSummaryPageDescription: "Section summary 1", collapsibleSummary: false, repeatingSection: false, repeatingSectionListId: null, @@ -58,11 +59,14 @@ describe("SectionEditor", () => { id: "section-2", title: "Section 2", alias: "alias", + introductionEnabled: true, introductionTitle: "Intro title", introductionContent: "Intro content", + introductionPageDescription: "Intro description", requiredCompleted: true, showOnHub: true, sectionSummary: false, + sectionSummaryPageDescription: "Section summary 2", collapsibleSummary: false, repeatingSection: false, repeatingSectionListId: null, @@ -169,8 +173,11 @@ describe("SectionEditor", () => { showOnHub: false, sectionSummary: true, validationErrorInfo: { + id: "1", + totalCount: 1, errors: [ { + id: "1", type: "section", field: "title", errorCode: "ERR_REQUIRED_WHEN_SETTING", @@ -229,8 +236,11 @@ describe("SectionEditor", () => { ...section1, title: "", validationErrorInfo: { + id: "2", + totalCount: 1, errors: [ { + id: "2", type: "section", field: "title", errorCode: "ERR_REQUIRED_WHEN_SETTING", diff --git a/eq-author/src/App/section/Design/SectionEditor/SectionIntroduction/index.js b/eq-author/src/App/section/Design/SectionEditor/SectionIntroduction/index.js index d5fd0b3019..d1a0472f00 100644 --- a/eq-author/src/App/section/Design/SectionEditor/SectionIntroduction/index.js +++ b/eq-author/src/App/section/Design/SectionEditor/SectionIntroduction/index.js @@ -103,8 +103,8 @@ const SectionIntroduction = ({ SectionIntroduction.propTypes = { section: CustomPropTypes.section.isRequired, handleUpdate: PropTypes.func.isRequired, - introductionTitleErrorMessage: PropTypes.string, - introductionContentErrorMessage: PropTypes.string, + introductionTitleErrorMessage: PropTypes.array, //eslint-disable-line + introductionContentErrorMessage: PropTypes.array, //eslint-disable-line }; export default SectionIntroduction; diff --git a/eq-author/src/App/section/Design/SectionEditor/__snapshots__/SectionEditor.test.js.snap b/eq-author/src/App/section/Design/SectionEditor/__snapshots__/SectionEditor.test.js.snap index e47a4df53c..67b3b35dc6 100644 --- a/eq-author/src/App/section/Design/SectionEditor/__snapshots__/SectionEditor.test.js.snap +++ b/eq-author/src/App/section/Design/SectionEditor/__snapshots__/SectionEditor.test.js.snap @@ -61,6 +61,7 @@ exports[`SectionEditor should render 1`] = ` "comments": Array [], "id": "section-1", "introductionContent": "Intro content", + "introductionEnabled": true, "introductionPageDescription": "Intro description", "introductionTitle": "Intro title", "questionnaire": Object { @@ -73,7 +74,7 @@ exports[`SectionEditor should render 1`] = ` "repeatingSectionListId": null, "requiredCompleted": true, "sectionSummary": false, - "sectionSummaryPageDescription": "Summary description", + "sectionSummaryPageDescription": "Section summary 1", "showOnHub": true, "title": "Section 1", "validationErrorInfo": Object { @@ -89,7 +90,7 @@ exports[`SectionEditor should render 1`] = ` errors={Array []} id="section-1" sectionSummary={false} - sectionSummaryPageDescription="Summary description" + sectionSummaryPageDescription="Section summary 1" /> { id: "1", title: "", alias: "", + introductionEnabled: true, + introductionPageDescription: "Introduction page description 1", introductionTitle: "

title

", introductionContent: "

Content

", requiredCompleted: false, showOnHub: false, sectionSummary: false, + sectionSummaryPageDescription: "Section summary 1", collapsibleSummary: false, repeatingSection: false, repeatingSectionListId: null, diff --git a/eq-author/src/App/section/Preview/__snapshots__/index.test.js.snap b/eq-author/src/App/section/Preview/__snapshots__/index.test.js.snap index cea1171df3..69648d228a 100644 --- a/eq-author/src/App/section/Preview/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/section/Preview/__snapshots__/index.test.js.snap @@ -40,6 +40,8 @@ exports[`PreviewSectionRoute should show the section intro preview when it is fi "comments": Array [], "id": "1", "introductionContent": "intro content", + "introductionEnabled": true, + "introductionPageDescription": "Introduction page description 1", "introductionTitle": "intro title", "questionnaire": Object { "hub": false, @@ -50,6 +52,7 @@ exports[`PreviewSectionRoute should show the section intro preview when it is fi "repeatingSectionListId": null, "requiredCompleted": false, "sectionSummary": false, + "sectionSummaryPageDescription": "Section summary 2", "showOnHub": false, "title": "", "validationErrorInfo": Object { diff --git a/eq-author/src/App/section/Preview/index.test.js b/eq-author/src/App/section/Preview/index.test.js index 9513dbbbd7..ef548c166f 100644 --- a/eq-author/src/App/section/Preview/index.test.js +++ b/eq-author/src/App/section/Preview/index.test.js @@ -31,9 +31,12 @@ describe("PreviewSectionRoute", () => { title: "", introductionTitle: "intro title", introductionContent: "intro content", + introductionEnabled: true, + introductionPageDescription: "Introduction page description 1", requiredCompleted: false, showOnHub: false, sectionSummary: false, + sectionSummaryPageDescription: "Section summary 2", collapsibleSummary: false, repeatingSection: false, repeatingSectionListId: null, @@ -70,9 +73,12 @@ describe("PreviewSectionRoute", () => { title: "", introductionTitle: "", introductionContent: "", + introductionEnabled: true, + introductionPageDescription: "Introduction page description 2", requiredCompleted: false, showOnHub: false, sectionSummary: false, + sectionSummaryPageDescription: "Section summary 2", collapsibleSummary: false, repeatingSection: false, repeatingSectionListId: null, diff --git a/eq-author/src/components/AnswerContent/RepeatLabelAndInput/index.test.js b/eq-author/src/components/AnswerContent/RepeatLabelAndInput/index.test.js index 9526b18b16..514f3ebfe4 100644 --- a/eq-author/src/components/AnswerContent/RepeatLabelAndInput/index.test.js +++ b/eq-author/src/components/AnswerContent/RepeatLabelAndInput/index.test.js @@ -1,6 +1,6 @@ import React from "react"; -import { render, fireEvent } from "tests/utils/rtl"; +import { render, fireEvent, waitFor } from "tests/utils/rtl"; import RepeatingLabelAndInput from "./index"; const handleUpdate = jest.fn(); @@ -25,8 +25,10 @@ const renderRepeatingLabelAndInput = (handleUpdate, answer) => ); describe("Repeating label and input", () => { - it("should render component", () => { - const { getByText } = renderRepeatingLabelAndInput(handleUpdate, answer); + it("should render component", async () => { + const { getByText } = await waitFor(() => + renderRepeatingLabelAndInput(handleUpdate, answer) + ); expect(getByText("Repeat label and input")).toBeTruthy(); }); @@ -35,7 +37,9 @@ describe("Repeating label and input", () => { answer.repeatingLabelAndInput = !answer.repeatingLabelAndInput; }); - const { getByTestId } = renderRepeatingLabelAndInput(handleUpdate, answer); + const { getByTestId } = await waitFor(() => + renderRepeatingLabelAndInput(handleUpdate, answer) + ); const toggle = getByTestId("repeat-label-and-input-toggle-input"); fireEvent.change(toggle, { target: { value: "On" } }); @@ -44,10 +48,12 @@ describe("Repeating label and input", () => { expect(handleUpdate).toHaveBeenCalled(); }); - it("should display collection lists", () => { + it("should display collection lists", async () => { answer.repeatingLabelAndInput = true; - const { getByText } = renderRepeatingLabelAndInput(handleUpdate, answer); + const { getByText } = await waitFor(() => + renderRepeatingLabelAndInput(handleUpdate, answer) + ); expect(getByText("Select a collection list")).toBeTruthy(); }); }); diff --git a/eq-author/src/components/ContentPickerv3/Menu.js b/eq-author/src/components/ContentPickerv3/Menu.js index 29dd61ccd4..c11413a076 100644 --- a/eq-author/src/components/ContentPickerv3/Menu.js +++ b/eq-author/src/components/ContentPickerv3/Menu.js @@ -264,7 +264,7 @@ SubMenu.propTypes = { onSelected: PropTypes.func.isRequired, isSelected: PropTypes.func.isRequired, isDisabled: PropTypes.func, - isCalculatedSummary: PropTypes.boolean, + isCalculatedSummary: PropTypes.bool, }; const FlatSectionMenu = ({ data, isCalculatedSummary, ...otherProps }) => @@ -290,7 +290,7 @@ const FlatSectionMenu = ({ data, isCalculatedSummary, ...otherProps }) => FlatSectionMenu.propTypes = { data: PropTypes.arrayOf( PropTypes.shape({ - id: PropTypes.string.isRequired, + id: PropTypes.string, }) ), }; diff --git a/eq-author/src/components/Forms/WrappingInput/index.js b/eq-author/src/components/Forms/WrappingInput/index.js index 0efd856966..ec85b679bf 100644 --- a/eq-author/src/components/Forms/WrappingInput/index.js +++ b/eq-author/src/components/Forms/WrappingInput/index.js @@ -27,7 +27,7 @@ const TextArea = styled(AutoResizeTextArea)` class WrappingInput extends React.Component { static propTypes = { - value: PropTypes.string.isRequired, + value: PropTypes.string, onChange: PropTypes.func.isRequired, onBlur: PropTypes.func.isRequired, onPaste: PropTypes.func, diff --git a/eq-author/src/components/modals/ImportContentModal/index.test.js b/eq-author/src/components/modals/ImportContentModal/index.test.js index a9d6d35f2a..4d22725816 100644 --- a/eq-author/src/components/modals/ImportContentModal/index.test.js +++ b/eq-author/src/components/modals/ImportContentModal/index.test.js @@ -9,6 +9,7 @@ const mockQuestionnaire = { }; const mockOnSelectQuestions = jest.fn(); +const mockOnSelectFolders = jest.fn(); const mockOnSelectSections = jest.fn(); const mockOnRemoveSingle = jest.fn(); const mockOnRemoveAll = jest.fn(); @@ -21,6 +22,7 @@ const setup = (props) => questionnaire={mockQuestionnaire} isOpen onSelectQuestions={mockOnSelectQuestions} + onSelectFolders={mockOnSelectFolders} onSelectSections={mockOnSelectSections} startingSelectedQuestions={[]} onConfirm={jest.fn()}