Skip to content

[SDK] React test coverage #5825

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

Merged
merged 1 commit into from
Dec 21, 2024
Merged

[SDK] React test coverage #5825

merged 1 commit into from
Dec 21, 2024

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Dec 21, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing testing coverage for various components and utilities in the thirdweb package, alongside some internal refactoring and improvements to error handling and media type resolution.

Detailed summary

  • Added tests for useConnectionManager to ensure it throws an error outside ThirdwebProvider.
  • Implemented and tested resolveMediaTypeFromUri for media type resolution.
  • Added tests for isSmartWallet functionality.
  • Enhanced MediaRenderer with new tests for IframePlayer and LinkPlayer.
  • Introduced mergeRefs utility with tests.
  • Updated getQueryKey for NFT name and media resolution with tests.
  • Improved useClipboard, useShowMore, and useDebouncedValue hooks with tests for expected behaviors.
  • Added tests for walletIcon utility to ensure correct icon retrieval based on provider.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Dec 21, 2024

⚠️ No Changeset found

Latest commit: 1b103d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 1:57pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 1:57pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 1:57pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 1:57pm

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 21, 2024
Copy link
Contributor Author

kien-ngo commented Dec 21, 2024


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

github-actions bot commented Dec 21, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.02 KB (0%) 901 ms (0%) 1.5 s (+21.73% 🔺) 2.4 s
thirdweb (cjs) 110.76 KB (0%) 2.3 s (0%) 2.7 s (-20.57% 🔽) 4.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 98 ms (+23.88% 🔺) 210 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 69 ms (+155.02% 🔺) 79 ms
thirdweb/react (minimal + tree-shaking) 19.1 KB (0%) 383 ms (0%) 375 ms (+22.56% 🔺) 757 ms

Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 86.76471% with 9 lines in your changes missing coverage. Please review.

Project coverage is 54.11%. Comparing base (3718020) to head (1b103d7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...react/web/ui/MediaRenderer/useResolvedMediaType.ts 57.14% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5825      +/-   ##
==========================================
+ Coverage   53.55%   54.11%   +0.55%     
==========================================
  Files        1102     1102              
  Lines       59163    59202      +39     
  Branches     4837     4885      +48     
==========================================
+ Hits        31685    32037     +352     
+ Misses      26760    26441     -319     
- Partials      718      724       +6     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 3718020
packages 51.50% <86.76%> (+0.68%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/thirdweb/src/react/core/utils/walletIcon.ts 100.00% <ø> (+34.09%) ⬆️
...b/src/react/web/ui/MediaRenderer/MediaRenderer.tsx 39.07% <100.00%> (+26.85%) ⬆️
...s/thirdweb/src/react/web/ui/prebuilt/NFT/media.tsx 78.48% <100.00%> (+8.48%) ⬆️
...es/thirdweb/src/react/web/ui/prebuilt/NFT/name.tsx 87.09% <100.00%> (+9.73%) ⬆️
...react/web/ui/MediaRenderer/useResolvedMediaType.ts 77.58% <57.14%> (-11.61%) ⬇️

... and 10 files with indirect coverage changes

Copy link
Contributor

graphite-app bot commented Dec 21, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on significant updates to wallet support, increasing the number of supported wallets from 350+ to 500+. It also includes various code deletions, modifications, and new features across multiple components and files.

### Detailed summary
- Increased wallet support from 350+ to 500+ across various components.
- Updated `version` in `package.json` files.
- Modified `ChainIcon` component to use a fallback icon.
- Added `ModalPreview` for connect modal examples.
- Updated descriptions in documentation and UI elements.
- Refactored several components for better code clarity and functionality.
- Deleted multiple unused assets and components.

> The following files were skipped due to too many changes: `apps/dashboard/src/components/icons/ChainIcon.tsx`, `packages/thirdweb/src/react/core/utils/structuralSharing.test.ts`, `packages/thirdweb/src/contract/deployment/utils/bootstrap.ts`, `packages/thirdweb/src/react/web/utils/resolveMimeType.test.ts`, `apps/portal/src/app/connect/wallet/sign-in-methods/external-wallets/page.mdx`, `apps/dashboard/src/hooks/useCsvUpload.ts`, `apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx`, `packages/thirdweb/src/react/web/ui/MediaRenderer/mime/mime.test.ts`, `apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx`, `apps/dashboard/src/app/(dashboard)/(chain)/components/server/chain-icon.tsx`, `packages/thirdweb/src/contract/deployment/utils/create-2-factory.ts`, `packages/thirdweb/src/react/web/ui/MediaRenderer/icons.test.tsx`, `packages/thirdweb/src/react/web/ui/hooks/useShowMore.test.tsx`, `packages/thirdweb/src/react/web/ui/hooks/useDebouncedValue.test.tsx`, `apps/portal/src/app/connect/page.mdx`, `apps/portal/src/app/connect/wallet/sign-in-methods/configure/page.mdx`, `packages/thirdweb/src/react/core/utils/walletIcon.ts`, `apps/portal/src/app/typescript/v5/adapters/page.mdx`, `apps/portal/src/app/connect/wallet/get-started/page.mdx`, `apps/portal/src/app/react/v5/adapters/page.mdx`, `packages/thirdweb/src/react/web/ui/MediaRenderer/MediaRenderer.test.tsx`, `apps/portal/src/app/nebula/api-reference/page.mdx`, `packages/thirdweb/src/react/core/utils/walletIcon.test.ts`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/insight/[blueprint_slug]/blueprint-playground.stories.tsx`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/insight/[blueprint_slug]/blueprint-playground.client.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/snapshot-upload.tsx`, `pnpm-lock.yaml`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE This pull request is still in progress and is not ready to be merged. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants