Add comprehensive Storybook stories for authentication components with Storybook 9 compatibility#168
Add comprehensive Storybook stories for authentication components with Storybook 9 compatibility#168Copilot wants to merge 18 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@copilot update branch and SOLVE CONFLICTS |
Branch updated and conflicts resolved! Merged the latest changes from main including MSW setup while preserving all authentication stories. All builds and tests pass. 891b376 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
remove the isolated components and use real component in storybook, but with mock auth state. take ProfileDropdown.stories.tsx as ref |
Completed! Removed isolated components ( |
|
solve CICD error |
Fixed CICD error! The issue was that auth stories were directly importing and trying to mock Firebase hooks from I removed the direct hook mocking from all auth stories and let the Storybook mock resolver handle the mocking automatically (similar to how ProfileDropdown works). Also added missing All builds now pass successfully:
Changes in commit 2f1b56f Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
7c580ba to
226826b
Compare
Co-authored-by: snomiao <7323030+snomiao@users.noreply.github.com>
…tate Co-authored-by: snomiao <7323030+snomiao@users.noreply.github.com>
…ybook 9 compatibility Co-authored-by: snomiao <7323030+snomiao@users.noreply.github.com>
- Fixed MDX syntax issues in Configure.mdx by converting function component to JSX element - Excluded problematic MDX files from Storybook build configuration to prevent build failures - Resolved package.json merge conflicts during rebase, keeping @storybook/react for Storybook 9 compatibility - Updated lockfile and MSW service worker after dependency resolution - Verified both Next.js and Storybook builds work successfully - All tests passing with proper linting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
205b9ed to
34cd28e
Compare
|
lets' redo this branch and respect to latest storybook folder structures accept theirs when conflicts |
… Storybook structure - Moved AuthUI.stories.tsx and Logout.stories.tsx from src/stories/components/auth/ to components/AuthUI/ - Removed redundant page stories (SignInPage, SignUpPage, LogoutPage) as component stories already show full page layout - Updated story imports to use mockFirebaseUser from mock file instead of redefining it - Changed imports to use CAPI from @/src/mocks/apibase for consistency - Updated story patterns to match ProfileDropdown.stories.tsx structure (satisfies Meta pattern, async beforeEach) - Simplified story variants to focus on key states (Default, Loading, AlreadyLoggedIn for AuthUI; Default and LoggedOut for Logout) - All builds verified: Next.js build ✓, Storybook build ✓, Tests ✓ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit fixes the issue where Storybook's manager UI files (like sb-manager/runtime.js) were being loaded from the root path instead of the /_storybook/ subdirectory, causing 404 errors when deployed. Changes: - Simplified .storybook/main.ts configuration by removing redundant managerHead and previewHead configurations that weren't working - Added post-build script (scripts/fix-storybook-paths.ts) to rewrite HTML file paths from relative (./file) to absolute (/_storybook/file) - Updated build-storybook script to run the path-fixing script after Storybook builds The script fixes both index.html (manager UI) and iframe.html (preview frame) to ensure all assets load from the correct /_storybook/ path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The path rewriting script is unnecessary since Storybook's Vite configuration already handles the base path with `base: '/_storybook/'`. This simplifies the build process and removes the post-build script. Addresses review comment: Use Storybook config instead of post-build script. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Fixed in commit 986b630. Removed the |
Resolve conflicts: - .storybook/main.ts: take main's version (a11y addon, base tag injection) - src/hooks/useFirebaseUser.mock.ts: take main's version using storybook/test - src/stories/Configure.mdx: take main's version - react-firebase-hooks/auth.mock.ts: align with main's storybook/test convention Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng stories The mock file caused all ProfileDropdown and other stories using useSignOut to fail in a11y tests because vitest browser mode resets mock return values between tests, leaving the hooks returning undefined (not iterable). Main works without this mock — the real hooks return iterable arrays. Our AuthUI/Logout stories only need useFirebaseUser mock, which they already use. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR implements comprehensive Storybook stories for all authentication-related components and pages, with proper Storybook 9.x compatibility by using Vitest mocking instead of the incompatible
@storybook/testpackage.📸 Screenshots
Sign In Component in Storybook:

Logout Component in Storybook:

✅ What was implemented
Component Stories (
Auth/section in Storybook)AuthUI/SignIn Component (
src/stories/components/auth/AuthUI.stories.tsx):Logout Component (
src/stories/components/auth/Logout.stories.tsx):Page Stories (
Pages/Auth/section in Storybook)Sign In Page (
src/stories/pages/auth/SignInPage.stories.tsx):/auth/loginSign Up Page (
src/stories/pages/auth/SignUpPage.stories.tsx):/auth/signupLogout Page (
src/stories/pages/auth/LogoutPage.stories.tsx):🔧 Technical Implementation
AuthUI,Logout) with proper Firebase auth state mocking@storybook/testwith Vitest'svi.fn()for mocking to resolve version conflictsargTypesfor testing different component statesreact-firebase-hooks/auth.mock.tsanduseFirebaseUser.mock.ts🎯 Benefits
📁 Files Added/Modified
🐛 Build Fixes
@storybook/test@8.xwith Vitest mocking to work withstorybook@9.xFixes #167.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.