Skip to content

wire frontend to real APIs - #303

Open
shreeyaadhikari wants to merge 7 commits into
mainfrom
Replace-mock-data-with-real-API-calls
Open

shreeyaadhikari wants to merge 7 commits into
mainfrom
Replace-mock-data-with-real-API-calls

Conversation

@shreeyaadhikari

@shreeyaadhikari shreeyaadhikari commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

ℹ️ Issue

Closes #248

📝 Description

Wire frontend pages to the real backend APIs and make tests CI-friendly by adding deterministic auth + API mocks so typecheck/tests don't fail when calling protected endpoints.

Briefly list the changes made to the code:

  1. Replaced hardcoded mock arrays with real API calls using useApi() in:
  • apps/frontend/src/app/donors/page.tsx
  • apps/frontend/src/app/donations/page.tsx
  • apps/frontend/src/app/accounts/page.tsx
  1. Made component tests deterministic and async safe:
  • Added per-test auth + fetch mocks for Donors, Donations, and AccountsPage tests so they no longer fail with 401s.
  • Updated assertions to use findBy / waitFor where needed.

✔️ Verification

image image image image image image

🏕️ (Optional) Future Work / Notes

@shreeyaadhikari
shreeyaadhikari marked this pull request as ready for review August 3, 2026 23:56
@github-actions
github-actions Bot requested a review from mehanana August 3, 2026 23:57
github-actions Bot added a commit that referenced this pull request Aug 3, 2026
@shreeyaadhikari shreeyaadhikari self-assigned this Aug 3, 2026

@nourshoreibah nourshoreibah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some comments on pieces I think may be broken! Would you please add the test-environment label to this pr and test your pr with the account i sent in proj-branch? just to make sure the linking actually workss

Comment thread apps/frontend/src/app/donations/page.tsx Outdated
Comment thread apps/frontend/src/app/accounts/page.tsx Outdated
Comment thread apps/frontend/src/app/accounts/page.tsx Outdated
Comment thread apps/frontend/src/app/donors/page.tsx Outdated

@mehanana mehanana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Apart from Nour's comments, I only found 1 small change needed!

Comment thread apps/frontend/src/app/accounts/page.tsx Outdated
@shreeyaadhikari shreeyaadhikari added the test-environment Creates a temporary (nearly free) test environment. Uses prod DB and cognito label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌿 ⏳ Creating preview environment… (logs)

@github-actions

Copy link
Copy Markdown
Contributor

🌿 Preview environment — ready ✅

Open: https://d3nmtjoh6ir9ym.cloudfront.net/pr-303/
API: https://i8z3sfdfpf.execute-api.us-east-2.amazonaws.com/prod

Shared RDS + Cognito (prod data); DB migrations are not applied here — if this PR adds a migration, endpoints using the new columns will fail until it merges. New commits update this environment in place — a note is posted here on each update. Remove the test-environment label or close the PR to tear it down.

@github-actions

Copy link
Copy Markdown
Contributor

🌿 Test environment updated in place ✅ — Click here to open. updated for fca978b · logs

@mehanana mehanana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good!

This branch was successfully deployed

1 active deployment
preview — 6030cb31 Deployed Aug 19, 2026 by shreeyaadhikari via deploy #199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-environment Creates a temporary (nearly free) test environment. Uses prod DB and cognito

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Replace mock data with real API calls (donors, donations, accounts)

3 participants