Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 70562d3

Browse files
feat: implement reset password page (Task 5.5) (#33)
* feat: implement reset password page (Task 5.5) * docs: update Task 5.5 status to PR * fix: resolve CI test failures and enhance pre-push hooks * fix: align React versions in ui-kit package to resolve CI test failures * fix: align CI environment with devcontainer (pnpm 10, node 20) * ci: add debugging information to identify test failures * fix: build packages before running tests in CI
1 parent 2ce71c6 commit 70562d3

File tree

19 files changed

+488
-44
lines changed

19 files changed

+488
-44
lines changed

.github/workflows/a11y-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: pnpm/action-setup@v3
1515
with:
16-
version: 8
16+
version: 10
1717
- uses: actions/setup-node@v4
1818
with:
1919
node-version: 20

.github/workflows/ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: pnpm/action-setup@v3
1515
with:
16-
version: 8
16+
version: 10
1717
- uses: actions/setup-node@v4
1818
with:
1919
node-version: 20
@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v4
2929
- uses: pnpm/action-setup@v3
3030
with:
31-
version: 8
31+
version: 10
3232
- uses: actions/setup-node@v4
3333
with:
3434
node-version: 20
@@ -45,15 +45,25 @@ jobs:
4545
- uses: actions/checkout@v4
4646
- uses: pnpm/action-setup@v3
4747
with:
48-
version: 8
48+
version: 10
4949
- uses: actions/setup-node@v4
5050
with:
5151
node-version: 20
5252
cache: "pnpm"
5353
- name: Install dependencies
5454
run: pnpm install
55+
- name: Debug environment
56+
run: |
57+
echo "Node version: $(node --version)"
58+
echo "pnpm version: $(pnpm --version)"
59+
echo "React version: $(pnpm list react --depth=0)"
60+
echo "Working directory: $(pwd)"
61+
echo "Available packages:"
62+
ls -la packages/
63+
- name: Build packages
64+
run: pnpm build
5565
- name: Test
56-
run: pnpm test || true # Replace with your test command
66+
run: pnpm test --reporter=verbose
5767

5868
build:
5969
runs-on: ubuntu-latest
@@ -62,7 +72,7 @@ jobs:
6272
- uses: actions/checkout@v4
6373
- uses: pnpm/action-setup@v3
6474
with:
65-
version: 8
75+
version: 10
6676
- uses: actions/setup-node@v4
6777
with:
6878
node-version: 20
@@ -79,7 +89,7 @@ jobs:
7989
- uses: actions/checkout@v4
8090
- uses: pnpm/action-setup@v3
8191
with:
82-
version: 8
92+
version: 10
8393
- uses: actions/setup-node@v4
8494
with:
8595
node-version: 20

.github/workflows/deploy-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Setup pnpm
4444
uses: pnpm/action-setup@v3
4545
with:
46-
version: 8
46+
version: 10
4747

4848
- name: Setup Node.js
4949
uses: actions/setup-node@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup pnpm
3030
uses: pnpm/action-setup@v3
3131
with:
32-
version: 8
32+
version: 10
3333

3434
- name: Setup Node.js
3535
uses: actions/setup-node@v4

.github/workflows/tokens-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install pnpm
2222
uses: pnpm/action-setup@v3
2323
with:
24-
version: 8
24+
version: 10
2525
run_install: false
2626

2727
- name: Setup Node.js

.husky/pre-push

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,56 @@ if echo "$PUSH_COMMAND" | grep -qE -- "--delete|-d"; then
1010
exit 0
1111
fi
1212

13-
# Run full test and build suite before pushing
14-
echo "Running full test and build suite before pushing..."
15-
pnpm lint && pnpm test && pnpm build && pnpm test:a11y
13+
# Function to run a command and report its status
14+
run_check() {
15+
local check_name="$1"
16+
local command="$2"
17+
echo "🔍 Running $check_name..."
18+
19+
if eval "$command"; then
20+
echo "$check_name passed"
21+
return 0
22+
else
23+
echo "$check_name failed"
24+
echo "⚠️ Push blocked due to failing $check_name"
25+
echo "💡 Fix the issues above, don't use --no-verify to bypass!!"
26+
return 1
27+
fi
28+
}
29+
30+
# Run comprehensive checks before pushing
31+
echo "🚀 Running pre-push checks..."
32+
echo "=================================================="
33+
34+
# 1. Lint check
35+
run_check "Linting" "pnpm lint" || exit 1
36+
37+
# 2. Test check with better error reporting
38+
echo "🧪 Running tests..."
39+
if ! pnpm test; then
40+
echo "❌ Tests failed"
41+
echo "📋 Common issues to check:"
42+
echo " • Missing dependencies (run: pnpm install)"
43+
echo " • Test logic errors (check test output above)"
44+
echo " • Async timing issues (check waitFor timeouts)"
45+
echo " • Mock configuration problems"
46+
echo "⚠️ Push blocked due to failing tests"
47+
echo "💡 Fix the issues above; don't use --no-verify to bypass!!"
48+
exit 1
49+
else
50+
echo "✅ Tests passed"
51+
fi
52+
53+
# 3. Build check
54+
run_check "Build" "pnpm build" || exit 1
55+
56+
# 4. Accessibility tests (if available)
57+
if pnpm run test:a11y --if-present >/dev/null 2>&1; then
58+
run_check "Accessibility tests" "pnpm run test:a11y" || exit 1
59+
else
60+
echo "⏭️ Accessibility tests not available, skipping"
61+
fi
62+
63+
echo "=================================================="
64+
echo "✅ All pre-push checks passed! 🎉"
65+
echo "🚀 Proceeding with push..."

docs/project_plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ A pragmatic breakdown into **four one‑week sprints** plus a preparatory **Spri
8383
| 5.1 | **Form inputs batch 2** – DatePicker, DateRangePicker, SliderInput, SpinnerInput, ComboBox, TextArea | Unit + a11y tests (≥90 % cov) & Storybook stories demonstrate disabled/error variants. ||
8484
| 5.2 | **Editor widgets** – MarkdownEditor (already complete) & CodeEditor (CodeMirror 6) | MarkdownEditor verified complete with security & a11y. CodeEditor implemented with syntax highlighting, themes, mobile support; bundle size increase ≤ 500 KB gzip total. ||
8585
| 5.3 | **Remaining layouts** – ErrorShell, MainFixedLayout, DataDenseLayout, Footer slot in MainLayout | Storybook snapshots approved in light/dark; axe-core passes. ||
86-
| 5.4 | **Showcase routes extension**`/settings` (MainFixedLayout), `/components` gallery, wildcard 404 page | Playwright E2E navigates: login → settings → gallery → invalid URL → 404; no console errors. | |
87-
| 5.5 | Add **Reset‑Password page** (AuthShell variant) | Route `/reset-password` renders form; Vitest form validation passes. | |
86+
| 5.4 | **Showcase routes extension**`/settings` (MainFixedLayout), `/components` gallery, wildcard 404 page | Playwright E2E navigates: login → settings → gallery → invalid URL → 404; no console errors. | |
87+
| 5.5 | Add **Reset‑Password page** (AuthShell variant) | Route `/reset-password` renders form; Vitest form validation passes. | PR |
8888
| 5.6 | Update documentation index & Storybook sidebar grouping | `npm run build-storybook` completes; new components appear under correct groups. | |
8989

9090
---
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Task 5.5 Planning: Reset Password Page (AuthShell variant)
2+
3+
## Overview
4+
5+
This task involves implementing a reset password page using the AuthShell layout component. The page should include a form with email input field, validation using React Hook Form and Zod, and proper routing integration in the showcase application.
6+
7+
## Task Breakdown
8+
9+
| Task Description | Definition of Done (DoD) | Status |
10+
| --------------------------------------------------- | ------------------------------------------------------------------------------- | -------- |
11+
| Create ResetPasswordPage component using AuthShell | Component created with proper AuthShell integration and styling | complete |
12+
| Implement reset password form with email validation | Form uses React Hook Form + Zod for email validation with proper error handling | complete |
13+
| Add route `/reset-password` to showcase router | Route properly configured in main.tsx and renders the component | complete |
14+
| Create unit tests for form validation | Vitest tests verify email validation and form submission behavior | complete |
15+
| Add navigation link from login page | Login page includes "Forgot Password?" link to reset password page | complete |
16+
| Create E2E test for reset password flow | Playwright test verifies navigation and form interaction | complete |
17+
| Update component exports and documentation | Component properly exported and accessible from ui-kit | complete |
18+
19+
## Implementation Notes
20+
21+
- **AuthShell Integration**: Use existing AuthShell component with appropriate width and styling
22+
- **Form Validation**: Use Zod schema for email validation (required field + valid email format)
23+
- **UI/UX**: Follow existing login page patterns for consistency
24+
- **Navigation**: Add link from login page, include back to login link on reset password page
25+
- **Accessibility**: Ensure proper form labeling and error message association
26+
27+
## Technical Requirements
28+
29+
- Form should validate email format and required field
30+
- Submit handler should show success/error toast messages
31+
- Component should be responsive and follow existing design patterns
32+
- Tests should cover both successful submission and validation errors
33+
- E2E test should verify complete user flow from login → reset password → back to login
34+
35+
## Completion Summary
36+
37+
**All tasks completed successfully!**
38+
39+
- **ResetPasswordPage component**: Created using AuthShell with proper styling and responsive design
40+
- **Form validation**: Implemented with React Hook Form + Zod for email validation
41+
- **Routing**: Added `/reset-password` route to showcase application
42+
- **Navigation**: Added "Forgot Password?" link from login page with back navigation
43+
- **Testing**: Created unit tests for form validation and E2E tests for user flow
44+
- **No exports needed**: This is a showcase page, not a UI kit component, so no exports to ui-kit required

packages/showcase/database.sqlite

0 Bytes
Binary file not shown.

packages/showcase/src/main.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ToastProvider } from "@etherisc/ui-kit";
55
import "./index.css";
66

77
import { LoginPage } from "./pages/LoginPage";
8+
import { ResetPasswordPage } from "./pages/ResetPasswordPage";
89
import { DashboardPage } from "./pages/DashboardPage";
910
import { CustomersPage } from "./pages/CustomersPage";
1011
import { SettingsPage } from "./pages/SettingsPage";
@@ -24,6 +25,10 @@ const router = createBrowserRouter([
2425
path: "/login",
2526
element: <LoginPage />,
2627
},
28+
{
29+
path: "/reset-password",
30+
element: <ResetPasswordPage />,
31+
},
2732
{
2833
path: "/dashboard",
2934
element: (

0 commit comments

Comments
 (0)