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 v5.6.0 #1630

Merged
merged 66 commits into from
Apr 13, 2021
Merged

build: release v5.6.0 #1630

merged 66 commits into from
Apr 13, 2021

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Apr 13, 2021

Release v5.6.0

This release includes quite a bit of Typescript migration and improvements, as well as first bits of API refactors from their current routes to clearer /api/v3/ rooted routes.

Features

  • refactor(misc-api): duplicate misc endpoints to new /api/v3 router #1573
  • refactor(user-api): duplicate user endpoints to new /api/v3 router #1553
  • ref(auth-api): duplicate auth endpoints to new /api/v3 router #1551

Improvements

  • chore: add createReqMeta to verification module logging #1562
  • chore: disable no-await-without-trycatch in backend #1623
  • chore: rearrange directory structure #1606
  • feat: migrate EncryptSubmissionRouter to own router, remove unused forms.server.controller, remove jasmine #1592
  • ref: migrate (most) /adminform endpoints to TypeScript, add integration tests #1567
  • refactor: collapse email preview submission middleware #1561
  • refactor: collapse encrypt preview submission middleware #1554
  • refactor: convert Bounce module to use neverthrow #1591
  • refactor: migrate admin-console client service to ts #1531
  • refactor: migrate frontend routes and google analytics factory to ts #1405
  • refactor: migrate public routes to TypeScript #1595
  • refactor: Minor cleanup to avoid using res.locals #1621
  • refactor: Refactor attachment upload into a service #1547
  • refactor: remove typecasts and non-null assertions #1596
  • refactor: update getPublicForm endpoint to typescript #1398
  • refactor(admin-form/controller): changed if-else in admin-form controller into chains #1622
  • refactor(webhook-services): migrate webhook services to neverthrow #1529
  • test: fix flakiness (again) by hardcoding created dates #1604
  • test: fix flaky form feedback test #1620
  • test: migrate file-validation util tests to TypeScript #1578
  • test: migrate logic.spec from javascript to typescript #1587
  • test: publicform integration tests #1572

Fixes

  • fix: /adminform integration tests being flakey by loosening some checks #1584
  • fix: clear current worker pool on download #1590
  • fix: convert bigint to string, not number to avoid losing fidelity #1577

Dependency changes

  • chore: uninstall sinon and ts-mock-imports (forreal) #1611
  • fix(deps): bump @opengovsg/spcp-auth-client from 1.4.4 to 1.4.5 [#1555 (https://github.com/fix(deps): bump @opengovsg/spcp-auth-client from 1.4.4 to 1.4.5 #1555)
  • [Snyk] Security upgrade mongoose from 5.11.10 to 5.12.3 #1538
  • fix(deps): bump aws-sdk from 2.879.0 to 2.880.0 #1570
  • fix(deps): bump aws-sdk from 2.880.0 to 2.882.0 #1585
  • fix(deps): bump aws-sdk from 2.882.0 to 2.883.0 #1609
  • fix(deps): bump aws-sdk from 2.883.0 to 2.884.0 #1615
  • fix(deps): bump libphonenumber-js from 1.9.14 to 1.9.16 #1569
  • fix(deps): bump twilio from 3.59.0 to 3.60.0 #1601
  • fix(deps): bump web-streams-polyfill from 3.0.2 to 3.0.3 #1618
  • fix(deps): bump winston-cloudwatch from 2.5.0 to 2.5.1 #1614
  • fix(deps): bump winston-cloudwatch from 2.5.1 to 2.5.2 #1626
  • chore(deps-dev): bump @babel/core from 7.13.14 to 7.13.15 #1600
  • chore(deps-dev): bump @babel/plugin-transform-runtime #1602
  • chore(deps-dev): bump @babel/preset-env from 7.13.12 to 7.13.15 #1599
  • chore(deps-dev): bump @types/bcrypt from 3.0.0 to 3.0.1 #1619
  • chore(deps-dev): bump @types/mongodb from 3.6.10 to 3.6.12 #1557
  • chore(deps-dev): bump @typescript-eslint/eslint-plugin #1556
  • chore(deps-dev): bump @typescript-eslint/eslint-plugin #1625
  • chore(deps-dev): bump @typescript-eslint/parser from 4.20.0 to 4.21.0 #1558
  • chore(deps-dev): bump @typescript-eslint/parser from 4.21.0 to 4.22.0 #1627
  • chore(deps-dev): bump concurrently from 6.0.0 to 6.0.1 #1568
  • chore(deps-dev): bump core-js from 3.9.1 to 3.10.1 #1608
  • chore(deps-dev): bump date-fns from 2.19.0 to 2.20.0 #1607
  • chore(deps-dev): bump date-fns from 2.20.0 to 2.20.1 #1617
  • chore(deps-dev): bump date-fns from 2.20.1 to 2.20.2 #1628
  • chore(deps-dev): bump eslint from 7.23.0 to 7.24.0 #1613
  • chore(deps-dev): bump eslint-plugin-jest from 24.3.3 to 24.3.4 #1559
  • chore(deps-dev): bump eslint-plugin-jest from 24.3.4 to 24.3.5 #1616
  • chore(deps-dev): bump ngrok from 4.0.0 to 4.0.1 #1560
  • chore(deps-dev): bump testcafe from 1.13.0 to 1.14.0 #1580
  • chore(deps-dev): bump typescript from 4.1.5 to 4.2.4 #1624

orbitalsqwib and others added 30 commits April 5, 2021 16:33
* refactor(corppass-ui): make ui changes for corppass

- updated copy for ui
- updated minimum necessary user-facing mentions of singpass and corppass to use new casing
- made necessary frontend changes for corporate singpass button
- added tooltip beside corppass option in settings > enable authentication
- updated e2e tests for new changes

* fix(start-page): increase corp login hor. padding
Bumps [@opengovsg/spcp-auth-client](https://github.com/opengovsg/spcp-auth-client) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/opengovsg/spcp-auth-client/releases)
- [Commits](opengovsg/spcp-auth-client@v1.4.4...v1.4.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.6.10 to 3.6.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.3.3 to 24.3.4.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](jest-community/eslint-plugin-jest@v24.3.3...v24.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ngrok](https://github.com/bubenshchykov/ngrok) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/bubenshchykov/ngrok/releases)
- [Changelog](https://github.com/bubenshchykov/ngrok/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bubenshchykov/ngrok/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* refactor(auth-api): duplicate auth endpoints to new /api/v3 router

- duplicate auth endpoint functionality and update endpoints
- update v3 router to use new endpoints
- update frontend api calls to use new endpoints

* test(auth-api): duplicate integration tests for new endpoint
* fix: package.json & package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MQUERY-1089718

* refactor(mongoose): rework type defs

* refactor(models): rework form.server.model for mongoose

- recast FormSchema as FormDocumentSchema so that we can
  register methods specific to the handling of IFormDocument
- declare Schema.Types.DocumentArrayWithLooseDiscriminator
  so that we can more easily register our sub-schema

TODO - submit a patch to mongoose to loosen the type def for
`DocumentArray.discriminator()`

Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com>
build: merge Release 5.5.0 into develop
…1529)

* ref: narrow types for getWebhookView

* ref: move hasProp to utils

* ref: implement service using neverthrow

* ref: implement webhook factory

* ref: delete old middleware factory

* ref: implement new middleware

* ref: use new factory function in controller

* refactor(webhook-service): add tests for webhook services

- moved webhook url validation to new file and updated references
- updated tests for webhook validation

ref #193

* fix(build): removed duplicate type for possible-database-error

* fix(webhook-service): use relative imports

* fix(webhook-factory): fix feature-guard conditional

* test(webhook-service) update webhook tests

* refactor(tests): clean up unit and model tests

* refactor(tests): do further cleaning of tests

* refactor(tests): add missing calledWith checks for mocks

* refactor(submission-model): clean up queries and webhook tests

Co-authored-by: Antariksh <antarikshmahajan@gmail.com>
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](kimmobrunfeldt/concurrently@v6.0.0...v6.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.9.14 to 1.9.16.
- [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/compare/v1.9.14...v1.9.16)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.879.0 to 2.880.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.879.0...v2.880.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1553)

* refactor(user-api): duplicate user endpoints to new /api/v3 router

- duplicate user endpoint functionality and update endpoints
- duplicated integration tests for new endpoint
- update v3 router to use new endpoints
- update frontend api calls to use new endpoints

* fix(auth-client-service): add missing /

* fix(v3-routes): fix import order
* refactor: Refactor attachment upload into a service

* Make changes based on mantariksh@'s comments

* Add formId to logging metadata for attachment uploading

* remove extraneous space
* feat(public/services/billingservice): added billing service

* feat(public/services/exampleservice): added example service

* test(public/services/billingservice): adds tests for getBillingInfo

* test(public/services/exampleservice): adds tests for getSingleExampleForm and getExampleForms

* refactor(billingservice): added dto types to fe/be and type annnotation on get for fe

* style(public/exampleservice): added curly braces; added type annotation on methods

* refactor(examples): adds dto to params and updated fe file naming to fit be

* test(examplesservice): updated tests to use new dto shape

* refactor(billing): updated billing fe/be to use dto

* test(billingservice): updated tests to use dto for params

* refactor(examples-list/controller): updated to use ExamplesService

* refactor(billing/client/controller): replaced AdminService  with new BillingService

* refactor(forms/client/routes): replaced AdminConsole with ExamplesService

* chore(main.js): deletes old admin-console.client.service

* test(billingservice): updated test blocks

* test(exampleservice): updated test blocks

* style(types/billing): imported LoginStatistic rather than redefining
…ks (#1584)

* test: loosen test checks due to non-deterministic mongo query

* test: fix flakiness due to Date

* test: remove invalid comment
Bumps [testcafe](https://github.com/DevExpress/testcafe) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/DevExpress/testcafe/releases)
- [Changelog](https://github.com/DevExpress/testcafe/blob/master/CHANGELOG.md)
- [Commits](DevExpress/testcafe@v1.13.0...v1.14.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.880.0 to 2.882.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.880.0...v2.882.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* refactor(modules/spcp): shifts get spcp session out into service

* refactor(modules/form): adds utility methods and refactored checkFormSubmission

* refactor(modules/form): refactors GET public forms end point from js to ts

* refactor(utils): adds utility type for all possible db errors

* fix(types/form): fixed the type of submissionLimit to allow for null

* refactor(modules/form): updated deactiveForm so that it uses never throw and adds logging

* refactor(modules/form): updated form limit checking to account for submission limit being null

* refactor(modules/form): adds logging to getSpcpSession

* refactor(modules/form): refactored handleGetPublicForm for clarity and code cleanliness

* refactor(publicformctrl): refactored handler for GET public forms to be cleaner and easier to read

* refactor(spcpsvc): added logging to extract JWT; updated typings for getSpcpSession

* revert(formsvc): removes retrievePublicForm (will be done in another PR) to limit scope

* style(public-form/controller): updated object to use variables

* style(services/types): updated documentation for functions and removed unneeded logging

* refactor(public-form/controller): refactored spcp flow so it's clearer

* refactor(public-form/controller): wip for myInfo

* refactor(myinfo): extracts myInfoCookiePayload to 2 types and adds utility function to differentiate

* refactor(public-form/controller): refactored myinfo chunk so it's neater

* test(form/service): fixes failing tests due to checkFormSubmissionLimitAndDeactivateForm

* refactor(myinfo): removed unneeded cookie type and updated extractSuccessfulCookie to reflect this

* docs(public-form/controller): adds docs to confusing sections of handlGetPublicForm

* test(public-form/controller/test): add test for database error when GET /getPublicForm

* test(public-form/controller/tests): add more tests

* test(public-form/controller/test): adds test for success cases

* refactor(myinfo): extracts out chunks form public-form controller into myinfo service

* refactor(public-form/controller): updated controller to use MyInfoFactory method

* test(public-form/controller/test): updated tests to use mocks

* fix(public-form/controller): fixed succesful  200 when auth using myInfo returning a private view

* test(public-form/controller/test): adds remaining tests for myInfo

* refactor(spcp): combined controller calls to spcp services into a single spcp call

* refactor(myinfo): refactored multiple controller calls to myInfo into a single call

* refactor(public-form): updated typings and refactored getPublicForm to be cleaner

* style(public-form/controller/test): updated comments in tests to use when

* refactor(form/service): updated deactiveForm to return the form itself; updated tests

* style(myinfo): extractMyInfoData renamed to fetchMyInfoData

* fix(public-form/controller): fixed bug where wrong extract cookie method is being called

* refactor(spcp/myinfo): removed extra logging in spcp; updated names in myinfo

* test(spcp/service/test): adds service tests

* test(spcp/service/test): adds unit tests for createFormWithSpcpSession

* test(myinfo.service): adds tests for createFormWithMyInfo

* feat(form): adds new errors and utility methods

* refactor(public-form): refactor to account for intarnet

* refactor(public-form/controller): added compatability for checking intranet access

* test(public-form/controller): adds tests for checking intranet; fixes old tests due to this addition

* style(spcp/service/test): changed naming to camelCase for variables

* fix(form.service): fixed intranet ip checking

* refactor(public-form): shifts utility method out into public form service

* test(public-form/controller): updates tests

* refactor(public-forms/server/routes): swaps to new controller for express middleware

* fix(myinfo/util): added cookie access check

* fix(form/service): adds error recovery for missing feature error when checking intranet access

* refactor(public-form/controller): tightened logic for myinfo error

* build(package.json): added ts-essential for UnreachableCaseException

* refactor(forms): added new type for intranet form

* refactor(spcp/service): updated service methods

* refactor(intranet/factory): updated isIntranetIp and factory signature typings

* refactor(myinfo): updated typings and factory methods to remove responsibility from service

* refactor(public-form/controller): wip

* refactor(form/service): remove result wrapping as only error is MissingFeatureError

* refactor(myinfo): updated typings and comments for myInfo

* refactor(publicform): updated handleGetPublicForm method and removed unused types

* refactor(public-form/service): removed unnused method

* fix(public-form/controller): changed returned form to be a publicForm

* test(myinfo/service): updated tests for myinfo service

* test(public-form/controller): updated tests to fit iwth refactor

* chore(intranet): removed unused variables

* test(intranet/service): fixes failing tests due to refactor

* refactor(app/utils): removed duplicate datatype in handle mongo errors

* style(form/service): updated logger message

* test(spcp/service): removed tests for deleted method; updated test for getSpcpSession

* refactor(public-form/controller): extracts logger meta property into a variable

* style(form/service): updated action property of logger meta

* docs(public-form/controller): updated comments for getPublicForm on conditions for  myInfoError

* refactor(myinfo): deleted unused middleware; made fetchMyInfoPersonData private

* refactor(myinfo): changed fetchMyInfoPersonData to become a private field

* test(myinfo): fixed factory and service tests due to making myInfoPersonData private

* chore(webhook/service/test): fixed import

* chore(types/forms): removed unused type declaration

* style(form/service): chains calls together for clarity

* refactor(myinfo): refactored methods so that atomic operations are performed together

* test(myinfo): fixes tests for myinfo

* style(spcp): renamed service methods for clarity; removed unused error

* test(spcp): fixes spcp tests

* refactor(public-form): updated controller to account for myinfo/spcp refactoring

* test(public-form): updated tests

* fix(public-form/controller): fixed cp returning userInfo as ewll
dependabot bot and others added 15 commits April 12, 2021 02:03
Bumps [@types/bcrypt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bcrypt) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bcrypt)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chore: merge release v5.5.1 back to develop
* test: replace usages of ts-mock-imports with jest mocks

apparently unneeded

* chore: remove sinon and ts-mock-imports
* chore: inline model tests

* chore: rename frontend.server.* to frontend.*

* chore: inline field validator tests

* chore: inline app/utils tests

* chore: move loaders and config into src/app

* chore: fix mock paths

* docs: update ARCHITECTURE.md

* chore: move shared tests into shared
…1573)

* refactor(misc-api): duplicate misc endpoints to new /api/v3 router

- duplicate bounce notifications, analytics and billing endpoints functionality
and update them to use the new api v3 routes
- update v3 router to use new endpoints
- update frontend api calls to use new endpoints

* refactor(files): organise misc-api folders and routers

- rename billing to billings for clarity
- add notifications router between v3 and bounce for clarity
- update router responsibilities for clarity

* refactor(misc-api): update file and router names

* fix(billings-tests): update billings tests to match merged changes
* feat(helpers/jest-db): adds util methods to get/update form while testing

* test(public-form/routes): adds integration tests for public-form

* chore(helpers/jest-db): removed unused helper method

* fix(public-form/controller): fixed regression issues where certain fields were missed

* test(public-form): fixed tests so that privateFormError is checked correctly
* test: fix flaky form feedback test

* ref: use compareAsc from date-fns
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.1.5...v4.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.20.1 to 2.20.2.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md)
- [Commits](date-fns/date-fns@v2.20.1...v2.20.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [winston-cloudwatch](https://github.com/lazywithclass/winston-cloudwatch) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/lazywithclass/winston-cloudwatch/releases)
- [Changelog](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lazywithclass/winston-cloudwatch/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@karrui

Tests

/api/v3/user

/api/v3/statistics

  • Viewing landing page statistics should work; check network tab and ensure new endpoint is being used

/api/v3/billings

  • Retrieving billing info should work; check network tab and ensure new endpoint is being used

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@mantariksh (sorry you are the only other person with GSIB)

Tests

Can probably do this alongside IE11/GSIB tests

/adminform refactor

All /adminform endpoints should work as is;

  • view dashboard forms
  • create email mode form
  • create storage mode form
  • view form builder
  • update form fields
  • update form logic
  • delete form
  • duplicate form
  • transfer form ownership
  • call /use-template on a form that does not belong to you; you may use https://staging.form.gov.sg/#!/6075052afcec600011922602
  • go to examples tab and look at a form; should display successfully
  • preview your own form
  • submit and view admin form feedback
  • download form feedback
  • form feedback count should be correct
  • storage mode responses count should be correct
  • view storage mode responses list
  • view individual storage mode response
  • upload image to image field
  • upload new form logo

EncryptSubmissionRouter

  • Should submit storage mode form successfully. Go and view response; should decrypt successfully

fix double download of csv

  • Attempt to download responses consecutively. The modal should not be stuck anymore and downloads should succeed. Try various combinations of csv-only, csv+attachments, etc.

Public form

  • isIntranetUser should be true, should show warning in form that has auth

Intranet IE11 runthrough

  • Create email mode form with all fields and custom start/end page. Activate and submit form. Check that you can receive responses in your intranet inbox.
  • Collaborators can be added in email mode.
  • Create storage mode form with all fields and custom start/end page. Activate and submit form.
  • Response CSV can be downloaded for storage mode.
  • Responses can be viewed in Data tab in storage mode.
  • Attachments for individual fields can be downloaded from Data tab in storage mode.
  • Attachment ZIP for submission 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.

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@tshuli

Tests

email preview submission middleware collapse

  • Create an email mode form with an email field with email confirmation. Submit the form in preview mode. You should receive both the admin response and the email confirmation, but the data tab should still show 0 responses.
  • Change the authType to SP and submit in preview mode. You should still receive the email confirmation and response email, with mock SingPass values.
  • Repeat with CorpPass
  • Add MyInfo fields and repeat with MyInfo. Additionally, all MyInfo fields should be shown with the [MyInfo] prefix in the response email.

encrypt preview submission middleware collapse

  • Create a storage mode form and add an email field with email confirmation. Submit it in preview mode. You should not be able to see the response in the data tab, but you should receive the email confirmation.
  • Change the authType to SP and submit in preview mode.
  • Change the authType to CP and submit in preview mode.

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@karrui

Tests

Bounce neverthrow

  • Create an email mode form. Add a valid collaborator with a registered contact number, and add a non-existent email as one of the email recipients. Submit the form. The form should NOT be deactivated, and the valid email recipient should not receive any emails/SMSes (other than the response itself). Check the document in the Bounces collection corresponding to the form ID. The bounces array should contain the correct hasBounced key for each email address.
  • Remove all valid email recipients and leave only non-existent emails. Submit the form. The form should be deactivated, and the form admin + collaborators should receive ONE email and TWO smses each, informing them of the bounce and form deactivation.

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@tshuli

Tests

admin-console client service

  • Click on examples after logging in - there should be multiple examples loaded
  • Login and create a form. Navigate to share and then click copy on Share Template. Open the copied url in another tab - the form should open as a template.
  • Login and navigate to billing.
    1. entering an invalid eserviceId should have 0 logins
    2. entering a valid eserviceId should have the logins for the specified time period.

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@tshuli

Tests

/frontend route refactor

  • Create a form. Open. Submit. Check that event shows up correctly on google analytics
  • Check that /frontend/environment endpoint displays the envvars
  • Check that /frontend/features endpoint displays the list of features and their activation state

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@karrui

Tests

public form api refactor

storage mode

  • create a form without authentication and share it. form should be viewable
  • create a SP authenticated form and share it. form should be viewable before/after signing in
  • create a CP authenticated form and share it. form should be viewable before/after signing in
  • for SP and CP forms, refresh the form after signing in and ensure that you are still signed in
  • for SP and CP forms, go to another SP/CP form after signing in and ensure that you are still signed in

email mode

  • create a form without authentication and share it. form should be viewable
  • create a SP authenticated form and share it. form should be viewable before/after signing in
  • create a CP authenticated form and share it. form should be viewable before/after signing in
  • create a myInfo authenticated form and share it. form should be viewable before/after signing in.
  • create a myInfo authenticated form and share it. reject the signin attempt on mockpass. form should have MyInfoError
  • for SP and CP forms, refresh the form after signing in and ensure that you are still signed in
  • for SP and CP forms, go to another SP/CP form after signing in and ensure that you are still signed in
  • for MyInfo forms, refresh the form after signing in and ensure that you are NOT still signed in and MyInfo cookie is cleared

@karrui
Copy link
Contributor Author

karrui commented Apr 13, 2021

@mantariksh

Tests

webhook server service neverthrow

  • Use ngrok to setup a webhook endpoint and setup a form with it
  • Set up the recieving server to return a 200 status code with some data and headers
  • Check that POST requests are recieved at the endpoint when the form is submitted
  • Check that the body and headers of the request are saved to the database correctly
  • Set up the receiving server to return a 400 status code with some data and headers
  • Check that an error is logged with the appropriate status code and data
  • Shut down the receiving server but keep ngrok running
  • Check that an error is logged with a 5xx status code and data

@karrui karrui merged commit a922e1f into release Apr 13, 2021
@karrui karrui deleted the release-v5.6.0 branch August 17, 2021 02:41
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.

8 participants