Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: release 4.49.0 #842

Merged
merged 52 commits into from
Dec 10, 2020
Merged

build: release 4.49.0 #842

merged 52 commits into from
Dec 10, 2020

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Dec 10, 2020

Improved

  • chore: enhance jest test reliability #800
  • chore: improve default submission error message #796
  • chore: log errors from concatResponse #817
  • docs: remove dangling commas from mongo scripts #794
  • feat: add ie11 specific styling for new template forms #834
  • feat: improve email mode messaging #825
  • feat: misc UX fixes #833
  • feat: tighten submission validation #751
  • fix: Travis Jest test not downloading mongo binary fast enough #826
  • ref: migrate copy template form flow to TypeScript  #793
  • ref: migrate create new form api flow to TypeScript #806
  • ref: migrate DELETE /{formId}/adminform endpoint flow to TypeScript #753
  • ref: migrate duplicate admin form endpoint to TypeScript #789
  • ref: migrate endpoint for getting admin form to TypeScript  #807
  • ref: migrate GET adminform/template endpoint to TypeScript #823
  • ref: migrate transfer ownership flow to TypeScript #718
  • refactor: convert Captcha to service #827
  • refactor: migrate date validator to ts #749
  • refactor: migrate decimal validator to ts #750
  • refactor: migrate prepareEmailSubmission to TypeScript #752
  • refactor: migrate validate- and receiveEmailSubmission to TypeScript #755
  • refactor/core: migrate & rename core controller to HomeController in TypeScript #788
  • test: raise global statement threshold #795

Bug fixes

  • fix: tear out response hash #837
  • fix: wrap initDate in a new Date object to avoid reference to minDate #816
  • fix: close create form modal when create form fails #824

Dependency upgrades

  • chore(deps-dev): bump @opengovsg/mockpass from 2.5.6 to 2.6.0 #821
  • chore(deps-dev): bump @types/express-serve-static-core #801
  • chore(deps-dev): bump @types/helmet from 0.0.48 to 4.0.0 #697
  • chore(deps-dev): bump @types/jest from 26.0.15 to 26.0.16 #812
  • chore(deps-dev): bump @types/node from 14.14.10 to 14.14.11 #829
  • chore(deps-dev): bump @types/node from 14.14.7 to 14.14.10 #813
  • chore(deps-dev): bump @typescript-eslint/parser from 4.7.0 to 4.9.0 #803
  • chore(deps-dev): bump csv-parse from 4.12.0 to 4.14.1 #745
  • chore(deps-dev): bump eslint-config-prettier from 6.15.0 to 7.0.0 #810
  • chore(deps-dev): bump eslint-plugin-simple-import-sort #820
  • chore(deps-dev): bump husky from 4.3.0 to 4.3.5 #819
  • chore(deps-dev): bump prettier from 2.2.0 to 2.2.1 #785
  • chore(deps-dev): bump type-fest from 0.18.0 to 0.20.2 #782
  • fix(deps): bump @sentry/browser from 5.27.3 to 5.28.0 #774
  • fix(deps): bump @sentry/browser from 5.28.0 to 5.29.0 #831
  • fix(deps): bump aws-sdk from 2.783.0 to 2.802.0 #783
  • fix(deps): bump aws-sdk from 2.802.0 to 2.805.0 #818
  • fix(deps): bump file-saver from 2.0.2 to 2.0.5 #784
  • fix(deps): bump libphonenumber-js from 1.7.55 to 1.9.5 #798
  • fix(deps): bump libphonenumber-js from 1.9.5 to 1.9.6 #832
  • fix(deps): bump neverthrow from 2.7.1 to 3.0.0 #797
  • fix(deps): bump validator from 13.1.17 to 13.5.1 #811
  • fix(deps): bump whatwg-fetch from 3.4.1 to 3.5.0 #804

karrui and others added 30 commits December 1, 2020 12:55
Bumps [csv-parse](https://github.com/wdavidw/node-csv-parse) from 4.12.0 to 4.14.1.
- [Release notes](https://github.com/wdavidw/node-csv-parse/releases)
- [Changelog](https://github.com/adaltas/node-csv-parse/blob/master/CHANGELOG.md)
- [Commits](adaltas/node-csv-parse@v4.12.0...v4.14.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 5.27.3 to 5.28.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@5.27.3...5.28.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chore: merge release v4.48.1 back into `develop`
Bumps [file-saver](https://github.com/eligrey/FileSaver.js) from 2.0.2 to 2.0.5.
- [Release notes](https://github.com/eligrey/FileSaver.js/releases)
- [Changelog](https://github.com/eligrey/FileSaver.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eligrey/FileSaver.js/commits)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.783.0 to 2.802.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.783.0...v2.802.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [type-fest](https://github.com/sindresorhus/type-fest) from 0.18.0 to 0.20.2.
- [Release notes](https://github.com/sindresorhus/type-fest/releases)
- [Commits](sindresorhus/type-fest@v0.18.0...v0.20.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(deps): bump neverthrow from 2.7.1 to 3.0.0

Bumps [neverthrow](https://github.com/supermacro/neverthrow) from 2.7.1 to 3.0.0.
- [Release notes](https://github.com/supermacro/neverthrow/releases)
- [Commits](supermacro/neverthrow@v2.7.1...v3.0.0)

Signed-off-by: dependabot[bot] <[email protected]>

* fix(MyInfoCtl): return promise

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
* fix(deps): bump libphonenumber-js from 1.7.55 to 1.9.5

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.7.55 to 1.9.5.
- [Release notes](https://gitlab.com/catamphetamine/libphonenumber-js/tags)
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/commits/master)

Signed-off-by: dependabot[bot] <[email protected]>

* fix(tests): update contact number used to be libphonenumber's example

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
* chore(deps-dev): bump prettier from 2.2.0 to 2.2.1

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@2.2.0...2.2.1)

Signed-off-by: dependabot[bot] <[email protected]>

* fix: lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
Bumps [whatwg-fetch](https://github.com/github/fetch) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/github/fetch/releases)
- [Commits](JakeChampion/fetch@v3.4.1...v3.5.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/helmet](https://github.com/helmetjs/helmet) from 0.0.48 to 4.0.0.
- [Release notes](https://github.com/helmetjs/helmet/releases)
- [Changelog](https://github.com/helmetjs/helmet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/helmetjs/helmet/commits/v4.0.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dangling commas cause the mongo shell to throw invalid syntax errors
* feat: manually set new mongo db server per test setup

instead of relying on @shelf/mongodb

* fix(temp): use isolatedModules in ts-jest

`isolatedModules` being set to true will fix a memory leak in ts-jest. However, type checking will not be performed whilst running tests (will still have type checking when writing tests).

Revert after the memory leak is fixed.
See kulshekhar/ts-jest#1967
See: https://kulshekhar.github.io/ts-jest/user/config/isolatedModules

* ref: use mongodb-memory-server-core instead of mongodb-memory-server

* chore(tests): inline mongo memory server generation

* chore: remove unused jest-environment-node dependency
* feat(FormModel): remove unneeded agency/admin keys in getFullFormById

* feat(AdminFormCtl): add handleGetAdminForm handler fn

for  GET /:formId/adminform

* test(AdminFormCtl): add tests for handleGetAdminForm

* ref(AdminFormRoutes): use new handleGetAdminForm handler fn

* test(AdminFormCtl): convert all id generation to strings from ObjectId
* feat(AdminFormRoutes): add Joi validation to duplicate form endpoint

* refactor(FormModel): rename duplicate method to getDuplicateParams

* ref(FormModel): update field selections when getting dashboard view

- remove form_fields selection, since it is not required for display, makes the return object from API a little smaller (and allows sharing of this type for getDashboardView instance method in a future commit)
- add responseMode selection -- this has no change, since responseMode is a discriminator key and is returned regardless, selection is made for explicitness

* ref(FormModel): inline un-shared FORM_DUPLICATE_KEYS

so any updates will not be too far away from the pick, and since the constant is not actually being used in the frontend.

* ref(FormModel): update getMainFields method to getDashboardFormView

changes include:
- name is made much more descriptive
- updates the shape returned to be common with the shape returned in getDashboardForms static method
- inject user directly in the function instead of reassigning after the function returns

* feat(FormSvc): add retrieveFormById service fn (and tests)

differs from retrieveFullFormById in that this retrieves the unpopulated form document

* feat(AdminFormSvc): add duplicateForm service function

* ref(adminFormUtils): update shape of DuplicateFormBody, OverrideProps

* test(adminFormUtils): add tests for processDuplicateOverrideProps

* test(AdminFormSvc): add duplicateForm tests

* feat(AdminFormCtl): add handleDuplicateForm handler fn

* feat(AdminForm): duplicated form logos are now set to default state

also remove isTemplate requirement in route not used, every single duplicated form should be reset to default logo state

* ref(AdminFormCtl): rename to handleDuplicateAdminForm

two duplicate functions, with different handlers. this rename separates them

* test(AdminFormCtl): add tests for handleDuplicateAdminForm

* test(FormModel): add getDashboardView tests

* ref(AdminFormRoutes): use new handleDuplicateAdminForm ctl fn

* feat(adminFormUtils): add JSDoc to processDuplicateOverrideProps

* fix(AdminFormRoutes): add withUserAuthentication middleware

* fix(AdminFormCtl): correct logger action handleDuplicateAdminForm

* test: use mockReturnValueOnce instead of mockImplementationOnce

* feat: remove isNew param from OverrideProps when creating object

seems to be legacy code, not used anywhere in the backend
Bumps [validator](https://github.com/chriso/validator.js) from 13.1.17 to 13.5.1.
- [Release notes](https://github.com/chriso/validator.js/releases)
- [Changelog](https://github.com/validatorjs/validator.js/blob/master/CHANGELOG.md)
- [Commits](validatorjs/validator.js@13.1.17...13.5.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(AuthSvc): add getFormIfPublic service fn (and tests)

* test(FormSvc): add tests for isFormPublic function

* feat(AdminFormCtl): add handleCopyTemplateForm handler fn

* feat(AdminFormRoutes): add Joi validation to /adminform/copy api

* ref(AdminFormRoutes): use new handleCopyTemplateForm handler

* feat: remove and track sending of isTemplate param when using template

related to #792

* test(AdminFormCtl): add tests for handleCopyTemplateForm

* feat: remove unused adminForms.duplicate function

* feat(AuthSvc): make overridden error message more generic

* ref(AdminFormCtl): unnest call to get dashboard view of duped form
* chore(deps-dev): bump @types/jest from 26.0.15 to 26.0.16

Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.15 to 26.0.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <[email protected]>

* fix: enhance types in tests to match jest expect

(or ignore for some cases)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
* feat: add joi validation to form creation route

* feat(AdminFormSvc): add createForm function (and tests)

difference from just calling Form.create is that it forces the admin form schema parameter to be a string

* feat(AdminFormCtl): add handleCreateForm handler fn (and tests)

* fix(sharedLogicUtils): use correct IFormSchema type

* feat: transformMongoError util xform mongoErrors to ApplicationErrors

* feat(AdminFormSvc): createForm to return transformed mongo error

* ref(AdminFormRoutes): use new create form handler function

remove the old function, update existing "integration" tests to use the new handler

* test(AdminFormCtl): add test cases for new returnable database errors

* test(AdminFormSvc): add test cases for asserting returned errors

* chore: trigger travis rebuild

* feat: remove unused  getDiscriminatedFormModel fn

* fix: use AdminFormController.handleCreateForm

(missed during rebase)
Bumps [husky](https://github.com/typicode/husky) from 4.3.0 to 4.3.5.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](typicode/husky@v4.3.0...v4.3.5)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
karrui and others added 15 commits December 9, 2020 14:06
* feat: update email prevention text and link

* feat: add info box when user only has a single email recipient

* feat: change update auth method toaster messaging

* feat: amend email form discouragement copy

* feat: update copy of form de/activation toast
* feat(formUtils): add removePrivateDetailsFromForm utility function

* feat: add formTitle variable to PrivateFormError and remove override

* feat(AdminFormCtl): add handleGetTemplateForm handler

for GET /:formId/adminform/template

* test(AdminFormCtl): add tests for handleGetTemplateForm

* ref(AdminFormRoutes): use AdminFormController.handleGetTemplateForm

* chore: trigger travis rebuild
* feat: change storage mode form typed declaration

* feat: remove verified toast on secret key verification success

just need toast after successfully activating the form

* feat: update storage mode guide link styling

only the word guide is linked, the brackets are outside

* feat: add spacing between each email in email form email list

that's a lot of emails in a sentence
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 5.28.0 to 5.29.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@5.28.0...5.29.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore: remove travis retry

flaky test is fixed

* fix: add globalSetup fn to download mongo binary before jest tests
build: merge 4.48.2 into develop
* feat: tear out response hash

* feat: remove json-stringify-deterministic dep
@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@tshuli

Tests

IE11 intranet tests for this week

  • COVID-19 templates in create form modal are aligned in wide layout (when all templates are in a row) and narrow layout (when templates are in 2 rows)
  • Text field to input email recipients has space in between emails in both create form modal and settings page
  • Settings page only, because the create form modal starts off blank
  • Secret key acknowledgement is "I have shared my secret key with a colleague"
  • Only one toastr on storage mode form activation (Congrats! Your form has gone live)
  • In create form modal, "guide" link does not include parantheses
  • UI updates are made as per feat: improve email mode messaging #825
  • Test data collation tool on a form with all field types
  • Test data collation tool on a form with all MyInfo field types

IE11 intranet general run-through

  • Create email mode form with all fields. Activate and submit form. Check that you can receive responses in your GSIB inbox.
  • Collaborators can be added in email mode.
  • Create storage mode form with all fields. Activate and submit form.
  • Response CSV can be downloaded for storage mode.
  • Responses can be viewed in Data tab in storage mode.
  • Attachments can be downloaded from Data tab in storage mode.
  • Submission IDs can be filtered in storage mode.
  • Collaborators can be added and their collaborating rights edited in storage mode.

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@karrui

Tests

Captcha

  • Submit a form with captcha
  • Submit a form with captcha enabled programmatically with an invalid captcha response. Response should be rejected with 400.
  • Submit a form without captcha
  • Submit a form on staging-alt

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@mantariksh

Tests

Migrate form ownership Typescript refactor

  • Open a form you are owner of. Transfer form ownership to a new collaborator that has logged in before. The form should be transferred to the new owner and you should become the editor.
  • Open a form you are owner of. Add someone as a viewer/editor to your form. Then transfer ownership. The form should be transferred to the new owner and you should become the editor.
  • Open a form you are owner of. Transfer form ownership to a non-existing collaborator e.g. [email protected]. Transfer ownership should fail with the toast message "xxx must have logged in once before being added as Owner"
  • Programatically transfer ownership without logging in. Should reject.
  • Programatically transfer ownership for a form you are not owner of. Should reject.
  • Programatically transfer ownership for an invalid form id. Should reject.
  • Programatically transfer ownership for an archived form. Should reject.

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@karrui

Tests

Email submissions
The following are all for email mode

  • Submit an attachment >5.5MB in email mode
  • Submit an email mode form with an email field with autoreply, as well as multiple attachments with the same filename. Check that the attachment filenames are de-duplicated in both the admin response and the email confirmation.
  • Table responses have [table] prefix in response email table and JSON data
  • Attachment responses have [attachment] prefix in response email table and JSON data
  • Verified email has [verified] prefix in response email table
    • optional verified email also has verified prefix
  • Verified mobile has [verified] prefix in response email table
  • Non-verified email does not have [verified] prefix
  • Non-verified mobile does not have [verified] prefix
  • MyInfo name field has [MyInfo] prefix
  • MyInfo non-verified field (e.g. marriage cert number) does not have [MyInfo] prefix

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@mantariksh

Tests

Field validators

  • Create two decimal fields. Hide one of them behind logic.
  • Check that validation on both visible and hidden decimal fields work when submitting programatically
  • Decimal input is rejected if it is not within the validation range
  • Decimal input is rejected if it has leading zeroes
  • Create two date fields. Hide one of them behind logic.
  • Check that validation on both visible and hidden date fields work when submitting programatically
  • Date input is rejected if it is not in the format 'DD MMM YYYY'
  • Date input is rejected if it is not within the validation range (isFutureOnly, isPastOnly, Custom Min / Max)

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@mantariksh

Tests

Form duplication

  • For all the tests below, the new duplicated form should appear on the dashboard

Storage mode duplication

  • Duplicate your own storage mode form to email mode should succeed with all fields and logic retained. The new form
    admin should be you.
  • Duplicate your own storage mode form to storage mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a storage mode form that you are editor of to email mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a storage mode form that you are editor of to storage mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a storage mode form that you are viewer of to email mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a storage mode form that you are viewer of to storage mode should succeed with all fields and logic retained. The new form admin should be you.

Email mode duplication

  • Duplicate your own email mode form to email mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate your own email mode form to storage mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a email mode form that you are editor of to email mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a email mode form that you are editor of to storage mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a email mode form that you are viewer of to email mode should succeed with all fields and logic retained. The new form admin should be you.
  • Duplicate a email mode form that you are viewer of to storage mode should succeed with all fields and logic retained. The new form admin should be you.

@karrui
Copy link
Contributor

karrui commented Dec 10, 2020

@mantariksh

Tests

Both retrieving template form and using template form

  • Go to examples tab and click on the example forms at random. The form should load and the logo should be of the agency opened.
  • Use an example template and create an email mode form. The form should be duplicated, but with your agency default logo state. All form fields and logic should be duplicated.
  • Use an example template with MyInfo fields and try to create a storage mode form. The duplication should be blocked due to MyInfo fields
  • Programatically attempt to retrieve template form for a private form. Should reject.

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@karrui

Tests

Date field bug

  • Create date field. Set custom date range with minimum date in the distant past (e.g. 2015). Open the form in public view. Check that the datepicker opens to the month of the minimum date by default.
  • Select a date on the date picker 1 year in the future. Check that there is no change to the minimum date.
  • Repeat the above with disallow past dates.
  • Create date field with no date validation. Open in public view. Check that the datepicker opens to the current month by default.

@karrui
Copy link
Contributor

karrui commented Dec 10, 2020

@mantariksh

Tests

Create new form

  • Create new email form. Should be created successfully.
  • Create new email mode template form. Should be created successfully.
  • Create new email form with different email list input. Should be created successfully
  • Create new storage mode form. Should be created successfully.
  • Create new storage mode template form. Should be created successfully.
  • Programatically create new form without logging in. Should reject

@karrui
Copy link
Contributor

karrui commented Dec 10, 2020

@mantariksh

Tests

View form dashboard

  • Should be able to see all forms you own on the dashboard
  • Programatically attempt to list all forms without logging in GET /adminform should reject since you are not logged in
  • Programatically attempt to list all forms by GET /adminform after logging in. Should list all forms.

@karrui
Copy link
Contributor

karrui commented Dec 10, 2020

@mantariksh

Tests

Delete admin form

  • Should be able to delete form successfully if you are admin.
  • Programatically attempt to delete form that you do not have permissions to. Should be rejected by calling DELETE /{formId}/adminform
  • Programatically attempt to delete form without logging in. Should be rejected.

@mantariksh
Copy link
Contributor Author

mantariksh commented Dec 10, 2020

@karrui

Tests

Tighten submission validation

  • Submit an email mode form with all form fields in preview mode.
  • Submit a storage mode form with all form fields in preview mode.
  • Create a Singpass email mode form with an autoreply email field. Submit the form and check that the NRIC is rendered correctly in both the admin response email and the autoreply email.
  • Create a Corppass email mode form with an autoreply email field. Submit the form and check that the UEN and UID are rendered correctly in both the admin response email and the autoreply email.
  • Create a Singpass storage mode form. Submit the form and check that the NRIC is rendered correctly in the data tab and the exported CSV. Add a form field and submit the form again. Check that the exported CSV has all the NRICs in the same column.
  • Programmatically submit a table field with no answerArray, but with answer as an empty string. Check that you get a 400 and not a 500 response.
  • Programmatically submit a table field with no answerArray, but with answer as a non-empty string. Check that you get a 400 and not a 500 response.
  • Programmatically submit a short text field with no answer, but with answerArray as an empty array. Check that you get a 400 and not a 500 response.
  • Programmatically submit a short text field with no answer, but with answerArray as a non-empty array. Check that you get a 400 and not a 500 response.

@mantariksh mantariksh merged commit 19f8b6f into release Dec 10, 2020
@liangyuanruo liangyuanruo deleted the release-4.49.0 branch January 14, 2021 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants