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
test(integration): integration tests for generate otp #1924
Merged
seaerchin
merged 9 commits into
refactor/migrate-generate-otp
from
test/integration-tests-generate-otp
May 27, 2021
Merged
test(integration): integration tests for generate otp #1924
seaerchin
merged 9 commits into
refactor/migrate-generate-otp
from
test/integration-tests-generate-otp
May 27, 2021
Conversation
This file contains 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
seaerchin
changed the title
Test/integration tests generate otp
test(integration): integration tests for generate otp
May 19, 2021
seaerchin
requested review from
mantariksh,
karrui,
chowyiyin,
tshuli and
yong-jie
May 19, 2021 03:39
seaerchin
force-pushed
the
refactor/migrate-generate-otp
branch
from
May 19, 2021 04:09
5b1315b
to
5140dbd
Compare
seaerchin
force-pushed
the
test/integration-tests-generate-otp
branch
from
May 19, 2021 04:15
8401558
to
9120107
Compare
chowyiyin
reviewed
May 20, 2021
src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts
Outdated
Show resolved
Hide resolved
mantariksh
suggested changes
May 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation is too strict as per discussion on #1916
src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts
Outdated
Show resolved
Hide resolved
src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts
Show resolved
Hide resolved
seaerchin
force-pushed
the
test/integration-tests-generate-otp
branch
from
May 24, 2021 05:16
56bed46
to
30e257b
Compare
mantariksh
approved these changes
May 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of suggested wording changes, otherwise lgtm
src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts
Outdated
Show resolved
Hide resolved
src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts
Outdated
Show resolved
Hide resolved
seaerchin
added a commit
that referenced
this pull request
May 27, 2021
…1916) * docs(verification): adds deprecation notice * feat(verification): add new backend route for generating otp * feat(fieldverificationservice): add new frontend call for generating otp * feat(verifiab-field-component): adds field type to component * fix(fieldverificationservice): exports otp function agian * docs(public-forms/verification/controller): added extra docs * feat(verification/controller): added stronger validation * docs(verification): updated docs for otp generation * test(verification-controller/spec): adds unit tests for controlelr * test(fieldverificationservice/test): updated tests for triggerSendOtp * chore(verifiable-field.client.component): removed console log * refactor(verification): removed fieldtype and let verification be more permissive * docs(verification/controller): add docs for steps * fix(verification/controller): removed fieldType from joi validation * test(integration): integration tests for generate otp (#1924) * feat(tests/integration/helpers): add new test helpers for nodmailer and twilio * test(verification/routes): added integration tests for generating otp * chore(tests/integration/helpers): removed nodemailer helper * test(public-forms/verification/routes): updated to not use mock nodemailer * test(public-forms/verification/routes/spec): adds missing import * test(public-forms/verification/routes): fixed test for expired transaction * test(public-forms/verification/routes): removed fieldType from integration tests * refactor(verification): fixed wording for tests and when email couldn't be send * test(verification): fixed tests after wording change
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.
Problem
#1916 had no integration tests to prevent PR from being too big
Solution
Adds integration tests for #1916
This also adds a new test helper for twilio. This is because twilio uses a function to initialise and we (might) need to dynamically change the result of an api call.
as hoisting with
jest
usingmock<someName>
doesn't work even with the fix here, the alternative was to shift this out and make it its own file so that callers (in our test env) are actually calling our mock twilio constructor, and within the test, we can alter the returned result dynamically