Skip to content

test(shared): add unit tests for getProfileUrl, getWebViewUrl, getDee…#296

Open
amritbej wants to merge 1 commit into
Dev-Card:mainfrom
amritbej:feature/test-url-utils-10
Open

test(shared): add unit tests for getProfileUrl, getWebViewUrl, getDee…#296
amritbej wants to merge 1 commit into
Dev-Card:mainfrom
amritbej:feature/test-url-utils-10

Conversation

@amritbej
Copy link
Copy Markdown
Contributor

Summary

Adds unit test coverage for shared URL utility functions in packages/shared/src/platforms.ts.

Closes #10


Type of Change

  • Tests only

What Changed

  • Added packages/shared/src/__tests__/platforms-url.test.ts

  • Added tests for:

    • getProfileUrl('github', 'octocat')
    • getWebViewUrl('linkedin', 'john')
    • getDeepLinkUrl('twitter', 'john')
  • Added coverage for unsupported/unknown platforms returning null

  • Followed existing Vitest testing conventions used in the repository


How to Test

  1. Install dependencies
pnpm install
  1. Run shared package tests
pnpm --filter shared test
  1. Verify all tests pass successfully

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 improving test coverage for shared URL utility helpers without modifying existing application behavior.

…pLinkUrl

Closes Dev-Card#10

- tests getProfileUrl('github', 'octocat') → https://github.com/octocat
- tests getWebViewUrl('linkedin', 'john') → correct LinkedIn webview URL
- tests getDeepLinkUrl('twitter', 'john') → correct Twitter deep link URL
- covers null returns for unsupported and unknown platforms
- follows existing Vitest describe/it/expect style
@Harxhit Harxhit added the gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. label May 24, 2026
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.

shared: add test coverage for getProfileUrl, getWebViewUrl, getDeepLinkUrl

2 participants