fix: react-doctor errors → 0 errors, 1649 warnings (46/100)

- Add requireAuth() to admin-permissions.ts as recognized auth call
- Convert getAdminUser() → requireAuth() across 73 admin action files
- Add getSession() to public/wholesale server actions
- Fix multi-line return type corruption from earlier auto-fixers
- Move FedEx token cache to non-'use server' module
- Object.freeze module-level constants: PRICE_KEYS, EMPTY_MOBILE_DASHBOARD,
  EMPTY_PAY_PERIOD, LOCALE_CART_SUBJECT, WELCOME_EMAILS
- Update Stripe API version 2026-05-27 → 2026-06-24
- Fix wholesale employee portal: getEmployeeSessionAction + EmployeePortalClient
- Fix 51 TypeScript errors (return type corruption, missing imports)
This commit is contained in:
Nora
2026-06-25 23:49:37 -06:00
parent 4d295ef062
commit 0ac4beaaa8
580 changed files with 52565 additions and 4953 deletions
+36
View File
@@ -0,0 +1,36 @@
> route-commerce-platform@2.0.0 test
> vitest run
RUN v2.1.9 /home/tyler/dev/routecomm
✓ src/lib/__tests__/design-tokens.test.ts (35 tests) 6ms
✓ tests/unit/send-password-reset-email.test.ts (8 tests) 16ms
✓ tests/unit/create-admin-user.test.ts (10 tests) 17ms
✓ tests/unit/water-log-reporting.test.ts (31 tests) 27ms
✓ tests/unit/email-service.test.ts (5 tests) 60ms
✓ src/lib/__tests__/format-date.test.ts (6 tests) 16ms
✓ tests/unit/sign-in-with-google.test.ts (6 tests) 13ms
✓ tests/unit/reset-admin-password.test.ts (11 tests) 16ms
stdout | tests/unit/auth-actions.test.ts > signOutAction > calls signOut and redirects to login
[auth/sign-out] Signing out
✓ tests/unit/auth-actions.test.ts (1 test) 3ms
✓ src/lib/offline/queue.test.ts (8 tests) 17ms
✓ src/lib/offline/sync.test.ts (13 tests) 18ms
tests/unit/getAdminUser.test.ts (11 tests | 3 failed) 8ms
× getAdminUser() > returns null when the email is not in the users table 3ms
→ expected undefined to be null
× getAdminUser() > returns null when the user exists but has no admin_user_brands row 0ms
→ expected undefined to be null
× getAdminUser() > returns a fully-populated AdminUser for a provisioned brand_admin 1ms
→ expected undefined to be 'admin@tuxedo.example' // Object.is equality
✓ tests/unit/water-log-pin.test.ts (21 tests) 429ms
✓ tests/unit/passwords.test.ts (9 tests) 572ms
Test Files 1 failed | 13 passed (14)
Tests 3 failed | 172 passed (175)
Start at 21:56:10
Duration 1.09s (transform 671ms, setup 0ms, collect 1.54s, tests 1.22s, environment 615ms, prepare 1.03s)