Skip to content

test: add ProfileLink component tests (#12)#180

Open
amritbej wants to merge 2 commits into
Dev-Card:mainfrom
amritbej:feature/tests-profilelink-component-12
Open

test: add ProfileLink component tests (#12)#180
amritbej wants to merge 2 commits into
Dev-Card:mainfrom
amritbej:feature/tests-profilelink-component-12

Conversation

@amritbej
Copy link
Copy Markdown
Contributor

Summary

Adds Jest + React Testing Library coverage for the ProfileLink component in the mobile app. This PR verifies that the component renders the correct platform/username information and correctly triggers the onPress callback interaction.

Closes #12


Type of Change

  • Bug fix
  • New feature
  • Refactor (no functional change)
  • UI / Design change
  • Tests only
  • Documentation
  • Infrastructure / DevOps
  • Security

What Changed

  • Added apps/mobile/__tests__/ProfileLink.test.tsx
  • Added render tests for platform and username text
  • Added press interaction test to verify onPress callback execution

How to Test

  1. Run:

    pnpm --filter @devcard/mobile test
  2. Verify the ProfileLink test suite passes successfully

  3. Confirm render and press interaction assertions execute correctly


Checklist

  • My code follows the project's coding style (pnpm -r run lint passes).
  • TypeScript compiles without errors (pnpm -r run typecheck).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (pnpm -r run test).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

Additional Context

This PR focuses only on adding automated tests for the ProfileLink component and does not modify component behavior.

@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label May 19, 2026
Copy link
Copy Markdown
Contributor

@ShantKhatri ShantKhatri left a comment

Choose a reason for hiding this comment

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

Implementation(files under src) files are changed, while the PR is of test. While writing tests, it's recommended that src files should be touched.

@amritbej
Copy link
Copy Markdown
Contributor Author

Implementation(files under src) files are changed, while the PR is of test. While writing tests, it's recommended that src files should be touched.

Got it, thanks for pointing that out. The src file changes were made only to support the test setup, but I understand that this PR should remain test-only.

Copy link
Copy Markdown
Contributor Author

@amritbej amritbej left a comment

Choose a reason for hiding this comment

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

I noticed that some unrelated implementation and dependency changes were accidentally included in this PR while setting up the tests. , and keep the PR focused only on the "ProfileLink" component tests.

Signed-off-by: amritbej.sh <amritbej750@gmail.com>
@amritbej
Copy link
Copy Markdown
Contributor Author

Hi @ShantKhatri , please merge my pr if there is no issue .. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mobile: add tests for ProfileLink component

3 participants