This document outlines how to verify the Testnet Hint feature implementation through CI/CD pipelines and local testing.
cd mux-frontend
npm install# Check for linting errors
npm run lint
# Auto-fix linting issues
npm run lint:fixExpected Output:
- No errors in new files
- No warnings in modified files
- Biome formatting compliance
# TypeScript compilation check
npx tsc --noEmitExpected Output:
- No type errors
- All types properly inferred
- Strict mode compliance
# Run all tests
npm run test
# Run specific test file
npm run test -- friendbot.test.ts
# Run with coverage
npm run test -- --coverage
# Watch mode for development
npm run test -- --watchExpected Output:
PASS src/utils/__tests__/friendbot.test.ts
PASS src/components/ui/__tests__/TestnetHint.test.tsx
PASS src/components/wallet/__tests__/WalletTable.integration.test.tsx
Test Suites: 3 passed, 3 total
Tests: 50+ passed, 50+ total
# Build the project
npm run build
# Check build output
ls -la .next/Expected Output:
- Build completes without errors
- No warnings about unused code
- All assets properly bundled
name: Testnet Hint Feature CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type check
run: npx tsc --noEmit
- name: Run tests
run: npm run test -- --coverage
- name: Build
run: npm run build
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json- Statements: 80%
- Branches: 75%
- Functions: 80%
- Lines: 80%
npm run test -- --coverageExpected Output:
File | % Stmts | % Branch | % Funcs | % Lines
------------------------------|---------|----------|---------|--------
All files | 85.2 | 82.1 | 88.5 | 85.2
src/utils/friendbot.ts | 100 | 100 | 100 | 100
src/components/ui/TestnetHint.tsx | 92 | 88 | 95 | 92
src/components/wallet/WalletTable.tsx | 78 | 75 | 80 | 78
The project uses Husky with lint-staged for pre-commit checks:
# Automatically runs on git commit
npm run prepareChecks:
- Biome formatting
- ESLint validation
- Type checking
- Test execution (optional)
- Testnet hint displays on testnet wallets page
- Testnet hint does NOT display on mainnet wallets page
- Testnet hint does NOT display on empty wallets page
- Dismiss button works correctly
- Friendbot link opens in new tab
- Learn More link opens in new tab
- Compact variant displays correctly
- Dark mode styling looks correct
- Hint appears when testnet wallets are present
- Hint disappears when dismissed
- Hint reappears on page reload
- Hint updates when wallets change
- Links have correct URLs
- Links have security attributes
- Keyboard navigation works
- Tab order is correct
- ARIA labels are present
- Color contrast is sufficient
- Screen reader announces content correctly
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile Safari
- Chrome Mobile
# Lighthouse audit
npm run build
npx lighthouse http://localhost:3000/demo/dashboard/walletsExpected Metrics:
- Performance: > 90
- Accessibility: > 95
- Best Practices: > 90
- SEO: > 90
- WalletTable still renders correctly
- Address truncation works
- Copy to clipboard works
- Explorer links work
- Network badges display correctly
- Status indicators display correctly
- Responsive design works
- Dark mode works
- ExplorerLink component works
- NetworkBadge component works
- StatusIndicator component works
- useCopyToClipboard hook works
npm run build
# Check .next/static/chunks/ for bundle sizesExpected:
- TestnetHint component: < 5KB gzipped
- friendbot utilities: < 1KB gzipped
- Total impact: < 6KB gzipped
# React DevTools Profiler
# Check component render timesExpected:
- TestnetHint render: < 1ms
- WalletTable render: < 5ms
- useMemo recalculation: < 1ms
- No XSS vulnerabilities (URL encoding verified)
- No injection attacks (input validation verified)
- No sensitive data exposure (no secrets in code)
- No broken authentication (N/A for this feature)
- No broken access control (N/A for this feature)
npm auditExpected:
- No critical vulnerabilities
- No high vulnerabilities
- All dependencies up to date
# Run accessibility audit
npx axe-core http://localhost:3000/demo/dashboard/walletsExpected:
- No violations
- No warnings
- All best practices followed
- NVDA (Windows)
- JAWS (Windows)
- VoiceOver (macOS/iOS)
- TalkBack (Android)
- Feature documentation complete
- Implementation guide complete
- Code comments present
- JSDoc comments present
- Usage examples provided
- API documentation complete
- Documentation matches implementation
- Examples are correct
- Links are valid
- Code snippets are accurate
# Deploy to staging
npm run build
# Deploy .next/ to staging server
# Verify on staging
curl https://staging.mux.example.com/demo/dashboard/walletsChecks:
- Feature loads without errors
- No console errors
- No network errors
- Performance acceptable
- All links work
# Deploy to production
npm run build
# Deploy .next/ to production server
# Verify on production
curl https://mux.example.com/demo/dashboard/walletsChecks:
- Feature loads without errors
- No console errors
- No network errors
- Performance acceptable
- All links work
- Analytics tracking works
- Monitor Sentry for errors
- Alert on new errors
- Track error frequency
- Monitor Core Web Vitals
- Alert on performance degradation
- Track user experience metrics
- Track hint dismissals
- Track Friendbot link clicks
- Track feature usage
- Revert commit
- Investigate root cause
- Fix in new branch
- Re-test thoroughly
- Re-deploy
git revert <commit-hash>
git push origin main- All tests passing
- No linting errors
- No type errors
- Code review approved
- Documentation complete
- Manual testing complete
- Accessibility verified
- Security verified
- Performance acceptable
- No regressions detected
- Ready for production
- Monitor error rates
- Monitor performance metrics
- Monitor user engagement
- Monitor accessibility issues
- Collect user feedback
- Keep dependencies updated
- Monitor for security issues
- Optimize performance
- Improve documentation
- Gather user feedback
- Document issue with reproduction steps
- Create GitHub issue
- Assign to team member
- Track resolution
- Update documentation
- Feature Owner: [Name]
- Code Reviewer: [Name]
- QA Lead: [Name]
- DevOps: [Name]