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

#4014 - Institution Read-Only User Type PART 2 (UI) (Part 2) #4338

Merged

Conversation

lewischen-aot
Copy link
Collaborator

As the second part of this story, this PR has the following changes:

  • Added E2E tests for the following endpoint methods:
    • createInstitutionUserWithAuth
    • updateInstitutionUserWithAuth
  • Added method mockBCeIDAccountDetails to mock the response from method bceIDService.getAccountDetails to assist the endpoint method createInstitutionUserWithAuth.

Screenshots of E2E tests
image

image

@lewischen-aot lewischen-aot added Enhancement New feature or request Institution Institution Features E2E/Unit tests labels Feb 10, 2025
@lewischen-aot lewischen-aot self-assigned this Feb 10, 2025
@lewischen-aot lewischen-aot marked this pull request as ready for review February 10, 2025 21:34
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Nice work and thanks for adding the E2Es on both methods. Please take a look at the comments.

* Mocks BCeID account info from BCeID service to return the passed BCeID account.
* @param testingModule nest testing module.
* @param user a persisted user object.
* @param displayName a persisted display name for user login.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the displayName from the comments.

Comment on lines 47 to 50
* @param testingModule nest testing module.
* @param user a persisted user object.
* @param displayName a persisted display name for user login.
* @param institution a persisted institution object.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please review the parameters.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes, looks good 👍
Please review the comments for the methods mockBCeIDAccountUserNotFound and mockBCeIDAccountUserFound, they have some leftovers comments to be cleanup 😉

@dheepak-aot dheepak-aot self-requested a review February 11, 2025 16:51
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.09% ( 3903 / 17668 )
Methods: 9.98% ( 226 / 2264 )
Lines: 25.42% ( 3369 / 13251 )
Branches: 14.31% ( 308 / 2153 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.59% ( 589 / 898 )
Methods: 59.63% ( 65 / 109 )
Lines: 68.72% ( 468 / 681 )
Branches: 51.85% ( 56 / 108 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 87.58% ( 1418 / 1619 )
Methods: 84.66% ( 160 / 189 )
Lines: 89.72% ( 1170 / 1304 )
Branches: 69.84% ( 88 / 126 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 69.89% ( 6250 / 8943 )
Methods: 67.34% ( 769 / 1142 )
Lines: 73.64% ( 4884 / 6632 )
Branches: 51.07% ( 597 / 1169 )

* @param institution a persisted institution object.
* @returns a persisted BCeID account object.
*/
export async function mockBCeIDAccountUserFound(
Copy link
Collaborator

@dheepak-aot dheepak-aot Feb 11, 2025

Choose a reason for hiding this comment

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

As @andrewsignori-aot mentioned, can we have a reset for this mock, so that we use the mock only when required and it defaults to original implementation otherwise.

If you are willing to have a reset in place. Here is a reference to do that Reset Mock Existing.

Btw, the comment is not a blocker.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @dheepak-aot. The rest mock is not needed in this case.

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Looks good @lewischen-aot. Just one comment which is not a blocker.

@lewischen-aot lewischen-aot added this pull request to the merge queue Feb 11, 2025
Merged via the queue into main with commit 7e5c75a Feb 11, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E/Unit tests Enhancement New feature or request Institution Institution Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants