Repository navigation
Conversation
Cover saving allowCopy through the real draft update path, the audit event payload for each value, and that a failed save publishes nothing. The Postman collection now checks that turning allowCopy on also turns on the reference number and confirmation email, that turning the reference number off is rejected and not saved, that allowCopy survives create-live and create-draft, and that turning it off keeps both settings.
|
nayij
marked this pull request as draft
November 6, 2026 13:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Adds tests for
allowCopy(DF-1193, "Reuse previous answers") that the unit tests from #878 left out. Tests only, no production code changes.Unit tests
form-definition-repository.test.js(updateOption, which goes throughmodifyDraftand the real V2 validation):allowCopyon savesmetadata.options.allowCopy: true, turns on the reference number, and switches the summary page toSummaryPageWithConfirmationEmailController, leaving the question pages unchangedallowCopy: falseand keeps the reference number and confirmation email onoptions.test.js(updateOptionOnDraftDefinition):'true'and'false', the value is passed to the repository, returned as{ option: { allowCopy } }, and published in theFORM_UPDATED/UPDATE_OPTIONaudit eventPostman integration tests
Ten requests added before "Save secret", on the go-live form:
allowCopyon returns 200, and the draft hasallowCopy, the reference number, the confirmation email summary page, and$$__formVersionallowCopyis on returns 400InvalidFormDefinitionError, and the draft is unchangedallowCopyis still set on the live definition aftercreate-live, and on the new draft aftercreate-draftallowCopyoff keeps the reference number and confirmation emailTesting
npx jest: 51 suites, 962 tests pass. ESLint, Prettier andtscare clean.modifyUpdateOptionmakes the new "turned on" repository test fail.Not covered here
Turning
allowCopyon fails when the summary page uses the legacy./pages/summary.jscontroller path.enableConfirmationEmailonly matchesControllerType.Summaryexactly, while the validator accepts legacy paths throughcontrollerNameFromPath. That needs a code fix, so it isn't in this PR.