CircularSpinner: convert to functional component + default testId#3076
Draft
michaelmendoza42 wants to merge 2 commits into
Draft
CircularSpinner: convert to functional component + default testId#3076michaelmendoza42 wants to merge 2 commits into
michaelmendoza42 wants to merge 2 commits into
Conversation
Migrates CircularSpinner from a class component to a functional component. Moves `data-testid` from the inner `<svg>` to the root wrapping `<div>` and defaults it to `"circular-spinner"`. Also drops the unused `AriaProps` from the public prop type (they were declared but never forwarded), and adds unit tests covering testId placement/defaults, size→dimension mapping, light/dark fill, and `style` forwarding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e8670f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Size Change: -71 B (-0.06%) Total Size: 127 kB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (30e98a0) and published all packages with changesets to npm. You can install the packages in ./dev/tools/deploy_wonder_blocks.js --tag="PR3076"Packages can also be installed manually by running: pnpm add @khanacademy/wonder-blocks-<package-name>@PR3076 |
Contributor
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-kuaeunrlsw.chromatic.com/ Chromatic results:
|
The size and light/dark fill tests reached into the rendered tree via
`container.querySelector("svg"|"path")`, which trips
`testing-library/no-container` and `testing-library/no-node-access`. Those
behaviors are unchanged by this PR and already covered by Chromatic
snapshots, so they don't pull their weight as regression guards here.
Also switched the remaining `style` test from `marginTop` to
`marginBlockStart` for the RTL-logical-properties rule.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CircularSpinnerfrom a class component to a functional component.data-testidfrom the inner<svg>to the root wrapping<div>and default it to"circular-spinner".AriaPropsfrom the public prop type (they were declared but never forwarded to any element).styleforwarding.Bumped as a
minorsince thedata-testidlocation move and the new always-on default are observable changes for consumers.Test plan
pnpm jest packages/wonder-blocks-progress-spinnerpassespnpm typecheckpassesButton's loading spinner still renders/identifies correctly (Button always passes an explicit testId, so the new default should not collide)🤖 Generated with Claude Code