-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Sponsor/Sponsee Connection System with Intent & Ownership (closes #300) #302
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
Open
Mnehmos
wants to merge
22
commits into
VolvoxCommunity:main
Choose a base branch
from
Mnehmos:feat/sponsor-sponsee-connection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
25d9eda
feat(profile): implement sponsor/sponsee connection system with inten…
Mnehmos 08aad2e
feat(profile): add opt-in matching system for sponsor/sponsee connect…
Mnehmos 9da4f6f
refactor(lib): extract shared utilities for DRY compliance
Mnehmos cfe3a41
fix(supabase): add revoked_at check to invite code UPDATE policy
Mnehmos c4eef81
fix(supabase): replace broad RLS policy with SECURITY DEFINER RPC
Mnehmos 4a22576
fix(supabase): convert UNIQUE constraint to partial index for rematching
Mnehmos cd03366
fix(privacy): fetch external handles only with mutual consent
Mnehmos ef4dea6
fix(security): prevent RLS violation in provider match creation
Mnehmos f284125
perf(settings): debounce external handles DB writes
Mnehmos 830ff06
fix(profile): fix timer stale values and clipboard error handling
Mnehmos 35bf3ba
refactor(settings): separate togglePlatform UI and data state
Mnehmos 4ed37a8
test(time-utils): fix flaky "exactly now" test with fake timers
Mnehmos e409f68
refactor(style): rename boolean props to use is/has prefix
Mnehmos 8050e2b
refactor(imports): use @/ alias for internal imports
Mnehmos 4e6c0c3
refactor(lib): extract shared SheetInputComponent for bottom sheets
Mnehmos 9f1876b
style(lib): add section dividers to platform-icons.tsx
Mnehmos 1753fc6
test(lib): add size verification to platform-icons tests
Mnehmos 5e45874
docs(changelog): consolidate duplicate Fixed sections and add PR revi…
Mnehmos 07e85cc
fix: address CodeRabbit review round 2 issues
Mnehmos abec902
refactor(profile): use ref-based mount guard in SymmetricRevealSection
Mnehmos c50391f
refactor(profile): rename boolean props to use is/has prefixes
Mnehmos 51d01f2
fix: address final CodeRabbit review comments
Mnehmos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import React from 'react'; | ||
| import { render } from '@testing-library/react-native'; | ||
| import { View } from 'react-native'; | ||
| import { getPlatformIcon, getPlatformLabel, platformLabels } from '@/lib/platform-icons'; | ||
|
|
||
| // Mock theme for testing | ||
| const mockTheme = { | ||
| primary: '#7c3aed', | ||
| info: '#3b82f6', | ||
| success: '#22c55e', | ||
| warning: '#f59e0b', | ||
| textSecondary: '#64748b', | ||
| }; | ||
|
|
||
| describe('platform-icons', () => { | ||
| describe('platformLabels', () => { | ||
| it('contains all expected platforms', () => { | ||
| expect(platformLabels.discord).toBe('Discord'); | ||
| expect(platformLabels.telegram).toBe('Telegram'); | ||
| expect(platformLabels.whatsapp).toBe('WhatsApp'); | ||
| expect(platformLabels.signal).toBe('Signal'); | ||
| expect(platformLabels.phone).toBe('Phone'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('getPlatformLabel', () => { | ||
| it('returns correct label for known platforms', () => { | ||
| expect(getPlatformLabel('discord')).toBe('Discord'); | ||
| expect(getPlatformLabel('telegram')).toBe('Telegram'); | ||
| expect(getPlatformLabel('whatsapp')).toBe('WhatsApp'); | ||
| expect(getPlatformLabel('signal')).toBe('Signal'); | ||
| expect(getPlatformLabel('phone')).toBe('Phone'); | ||
| }); | ||
|
|
||
| it('returns the key itself for unknown platforms', () => { | ||
| expect(getPlatformLabel('unknown')).toBe('unknown'); | ||
| expect(getPlatformLabel('custom_platform')).toBe('custom_platform'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('getPlatformIcon', () => { | ||
| it('returns an icon for discord', () => { | ||
| const icon = getPlatformIcon('discord', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('returns an icon for telegram', () => { | ||
| const icon = getPlatformIcon('telegram', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('returns an icon for whatsapp', () => { | ||
| const icon = getPlatformIcon('whatsapp', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('returns an icon for signal', () => { | ||
| const icon = getPlatformIcon('signal', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('returns an icon for phone', () => { | ||
| const icon = getPlatformIcon('phone', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('returns a default icon for unknown platforms', () => { | ||
| const icon = getPlatformIcon('unknown', mockTheme); | ||
| const { getByTestId } = render(<View testID="icon-container">{icon}</View>); | ||
| expect(getByTestId('icon-container').children).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('respects custom size parameter', () => { | ||
| const icon = getPlatformIcon('discord', mockTheme, 24); | ||
| const { root } = render(<View testID="icon-container">{icon}</View>); | ||
| // Find the icon element (Svg component from lucide-react-native) | ||
| const iconElement = root.findByProps({ testID: 'icon-container' }).props.children; | ||
| expect(iconElement.props.size).toBe(24); | ||
| }); | ||
|
|
||
| it('uses default size of 16 when not specified', () => { | ||
| const icon = getPlatformIcon('telegram', mockTheme); | ||
| const { root } = render(<View testID="icon-container">{icon}</View>); | ||
| const iconElement = root.findByProps({ testID: 'icon-container' }).props.children; | ||
| expect(iconElement.props.size).toBe(16); | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.