Skip to content

Improve test coverage for in-person proofing#6680

Merged
aduth merged 6 commits intomainfrom
aduth-lg-6437-clean-up
Aug 5, 2022
Merged

Improve test coverage for in-person proofing#6680
aduth merged 6 commits intomainfrom
aduth-lg-6437-clean-up

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Aug 2, 2022

Why: Since this test coverage should have been included in its initial introduction in #6634, #6661.

@aduth aduth marked this pull request as draft August 2, 2022 19:22
Avoid creating a new user instance
@aduth aduth marked this pull request as ready for review August 2, 2022 19:28
Avoid duplicate use resulting in foreign key constraint violation
@aduth aduth requested review from a team and tomas-nava August 5, 2022 14:03
end

def begin_in_person_proofing(_user = user_with_2fa)
def begin_in_person_proofing(_user = nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument was previously unused, and the user_with_2fa method is non-trivial, so should help performance slightly to avoid calling it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove the _user parameter for each of these methods where it's unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove the _user parameter for each of these methods where it's unused?

I'm of two minds about it. I sorta wish we didn't ever need to pass the argument, but there are some instances where we do need to reference it (example), and I'd rather we be consistent about the signature with these complete_x_step helpers than to (a) leave a developer unsure if they need to pass it and (b) make it a hassle if ever the helper did need to reference the user (i.e. updating all call sites). So the thinking with this is to expect it to be passed if it's known, acknowledging that it's not actually used currently, but leaving it open so that it could be used, and having a consistent argument signature.

Copy link
Contributor

@sheldon-b sheldon-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

end

def begin_in_person_proofing(_user = user_with_2fa)
def begin_in_person_proofing(_user = nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove the _user parameter for each of these methods where it's unused?

@aduth aduth merged commit 63bae14 into main Aug 5, 2022
@aduth aduth deleted the aduth-lg-6437-clean-up branch August 5, 2022 16: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.

2 participants