Skip to content

Connected to frontend with e2e testing on create member and sign up form - #60

Open
Allimonae wants to merge 1 commit into
mainfrom
create-member-connect
Open

Connected to frontend with e2e testing on create member and sign up form#60
Allimonae wants to merge 1 commit into
mainfrom
create-member-connect

Conversation

@Allimonae

@Allimonae Allimonae commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Renames matchingPref to matchPref across the frontend
  • Connect the sign-up form to the/api/members endpoint
  • Add controller and service tests for member creation.

What changed?

  • Renamed matchingPref to matchPref in the MemberProfileValues interface, Zod schema, and all related form field bindings and handlers in SignUpForm.tsx.
  • Renamed the local matchingPrefOptions variable to matchingPreferenceOptions for clarity.
  • Replaced the placeholder Promise.resolve() stub in SignUpForm's submit handler with a real POST /api/members fetch call. On success, the form is reset; on failure, an error message from the API response (or a fallback) is displayed; on network error, a connection-specific message is shown.
  • Added MemberControllerTest covering successful member creation, validation rejection on blank fullName, and conflict response on duplicate email.
  • Added MemberServiceTest covering successful member creation with all fields and duplicate email detection (verifying createMember on the repo is never called in that case).

How to test?

  1. Run the sign-up form in the browser and submit a valid registration — confirm the form submits to /api/members, resets on success, and displays appropriate error messages on failure or network issues.
  2. Submit the form with a duplicate email and confirm a conflict error is shown.
  3. Run MemberControllerTest and MemberServiceTest and confirm all tests pass.

Why make this change?

The matchingPref field name was inconsistent with the backend's matchPref naming convention, causing a mismatch between the frontend payload and the API contract. The form also lacked a real API integration, relying on a placeholder stub that never actually persisted data. Tests were added to establish baseline coverage for the member creation flow.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Allimonae
Allimonae force-pushed the create-member-connect branch 3 times, most recently from 078696f to c3deb0a Compare July 21, 2026 17:16
@Allimonae
Allimonae force-pushed the create-member-connect branch from c3deb0a to d3b485e Compare July 24, 2026 17:10
@sonarqubecloud

Copy link
Copy Markdown

@Allimonae
Allimonae marked this pull request as ready for review July 24, 2026 17:17
@Allimonae
Allimonae requested a review from a team as a code owner July 24, 2026 17:17
@graphite-app
graphite-app Bot requested review from Arshadul-Monir and arklian July 24, 2026 17:17
@graphite-app

graphite-app Bot commented Jul 24, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (07/24/26)

2 reviewers were added to this PR based on Henry Chen's automation.

.build();
Member updatedMember = memberRepo
.updateMember(member)
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Member not found"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit - should probably be MemberNotFoundException for consistency. it will ultimately end up being a 404 anyway

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(i know this isnt part of the PR but might as well fix it here 🙃

// TODO: Implement test cases for MemberService methods after createMember

// @Test
// void testUpdateMember() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i guess we'll be adding these in another PR? is updateMember not fully functional yet?

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