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

test(integration): integration tests for generate otp #1924

Merged

Conversation

seaerchin
Copy link
Contributor

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 using mock<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

@seaerchin seaerchin changed the title Test/integration tests generate otp test(integration): integration tests for generate otp May 19, 2021
@seaerchin seaerchin changed the base branch from develop to refactor/migrate-generate-otp May 19, 2021 03:38
@seaerchin seaerchin force-pushed the refactor/migrate-generate-otp branch from 5b1315b to 5140dbd Compare May 19, 2021 04:09
@seaerchin seaerchin force-pushed the test/integration-tests-generate-otp branch from 8401558 to 9120107 Compare May 19, 2021 04:15
@seaerchin seaerchin requested review from karrui and removed request for karrui May 19, 2021 08:50
@seaerchin seaerchin requested a review from chowyiyin May 20, 2021 02:33
Copy link
Contributor

@mantariksh mantariksh left a 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

@seaerchin seaerchin force-pushed the test/integration-tests-generate-otp branch from 56bed46 to 30e257b Compare May 24, 2021 05:16
@seaerchin seaerchin requested a review from mantariksh May 24, 2021 05:16
Copy link
Contributor

@mantariksh mantariksh left a 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

@seaerchin seaerchin merged commit 51c67e8 into refactor/migrate-generate-otp May 27, 2021
@seaerchin seaerchin deleted the test/integration-tests-generate-otp branch May 27, 2021 04:49
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants