Skip to content

feat: add integration tests for isOwnWallet and implement isOwnWallet…#535

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Stanley-Owoh:add-integration-test-for-isownwallet-edit-controls-533
Jul 19, 2026
Merged

feat: add integration tests for isOwnWallet and implement isOwnWallet…#535
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Stanley-Owoh:add-integration-test-for-isownwallet-edit-controls-533

Conversation

@Stanley-Owoh

Copy link
Copy Markdown
Contributor

Add integration test for isOwnWallet helper controlling visibility of edit controls

Summary

Edit controls on the creator profile (update bio, change avatar) should only be visible when the viewing wallet matches the creator's own wallet. This PR adds the isOwnWallet helper, wires it into CreatorProfileHeader, and covers the behaviour with integration tests.

Changes

New

  • src/utils/isOwnWallet.ts — Pure helper that case-insensitively compares a connected wallet address against a creator address; returns false when either is missing.
  • src/utils/__tests__/isOwnWallet.test.ts — Unit tests for the helper (exact match, case-insensitive match, mismatch, null/undefined/empty inputs).
  • src/components/common/__tests__/CreatorProfileHeader.isOwnWallet.integration.test.tsx — Integration tests verifying:
    • Edit controls are absent from the DOM for a non-owner wallet
    • Edit controls are present for the owner wallet
    • Address matching is case-insensitive
    • Controls toggle when the connected wallet changes
    • Controls are hidden when no wallet is connected

Modified

  • src/components/common/CreatorProfileHeader.tsx — Added connectedWalletAddress prop. Edit buttons ("Edit Bio", "Change Avatar") render conditionally via {own && (...)} so they are absent from the DOM for non-owners.

Acceptance Criteria

  • Edit controls hidden for non-owner wallet
  • Edit controls visible for owner wallet
  • Controls are absent from DOM (not just hidden with CSS) for non-owners

Closes #533

@Stanley-Owoh
Stanley-Owoh force-pushed the add-integration-test-for-isownwallet-edit-controls-533 branch from a4dbe5f to 5ee57e3 Compare July 19, 2026 11:00
@Chucks1093
Chucks1093 merged commit 3ffcdf9 into accesslayerorg:dev Jul 19, 2026
1 check passed
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.

Add integration test for isOwnWallet helper controlling visibility of edit controls

2 participants