Fix preview typing, add test coverage, dedupe initials, fix billing cancel dialog - #1038
Merged
Merged
Conversation
…rameProps Closes StellerCraft#1007 Co-authored-by: Mystery <fidelisobed79@gmail.com>
…rror paths Closes StellerCraft#1006 Co-authored-by: Mystery <fidelisobed79@gmail.com>
…nd MobileDrawer Closes StellerCraft#1005 Co-authored-by: Mystery <fidelisobed79@gmail.com>
…ion failure Closes StellerCraft#1004 Co-authored-by: Mystery <fidelisobed79@gmail.com>
|
@Mystery-CLI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Bundles four small, independent frontend fixes:
src/components/app/preview/PreviewIframe.tsx): replacedcustomization?: anywithcustomization?: CustomizationConfig, matchingPreviewWorkspaceProps. No behavior change. AddedPreviewIframe.test.tsxsince no test file existed, asserting the generated iframesrcincludes the serialized customization.src/hooks/usePreviewService.test.ts, new): coversisLoadingtoggling across success/failure,errorbeing set to the thrownError's message (with'Failed to generate preview'fallback for non-Error throws) and re-thrown to the caller, andrefreshPreviewdelegating togeneratePreviewwith the same arguments via a spy onpreviewService.generatePreview.getInitialshelper: extracted the duplicated initials logic out ofUserMenu.tsxandMobileDrawer.tsxintosrc/lib/format/initials.ts, updated both components to import it, and addedsrc/lib/format/initials.test.tscovering single-word names, extra internal whitespace, leading/trailing whitespace, >2 word names, and empty/whitespace-only input.src/app/app/settings/billing/page.tsx):handleCancelno longer unconditionally closes the confirm dialog and clears state infinally. On failure the dialog now stays open with an inlinerole="alert"error message (cancelErrorstate), andcancellingstill resets so the retry button re-enables. The dialog only closes on success. Added a failure-path test inpage.test.tsxmocking a non-ok/api/payments/cancelresponse and asserting the dialog stays open with the inline error and no cancellation notice.Issues closed
Closes #1007
Closes #1006
Closes #1005
Closes #1004
Test plan
pnpm typecheck— confirmCustomizationConfigtyping compiles cleanly at all call sitespnpm lintpnpm test --filter=frontend -- PreviewIframepnpm test --filter=frontend -- usePreviewServicepnpm test --filter=frontend -- initialspnpm test --filter=frontend -- billing