diff --git a/TODO.md b/TODO.md index 4909fbe..2508d72 100644 --- a/TODO.md +++ b/TODO.md @@ -1,82 +1,55 @@ -# TODO - Issues Found from Code Quality and E2E Tests +# TODO - Deno Check Errors -## Code Formatting Issues (deno task check) +## TypeScript Errors Found (51 total) -### Critical Issues +### Common Error Pattern +Most errors are `TS7031: Binding element 'page' implicitly has an 'any' type` in test files. -- **5 files not formatted properly** - Need to run `deno fmt` to fix formatting -- Files affected: - - `routes/tenant/messages/index.tsx` - Import order and formatting issues - - `routes/tenant/settings/index.tsx` - Function definition formatting and - indentation - - `services/messageService.ts` - Import order issues - - Additional files with formatting problems (truncated output) +### Files Requiring Fixes -### Specific Formatting Problems +1. **tests/e2e/helpers.ts:82:31** - `({ id })` parameter has implicit any type +2. **tests/e2e/invite-tenant.spec.ts** - Multiple test functions with `page` parameter + - Line 4:62 + - Line 77:75 +3. **tests/e2e/landlord-dashboard.spec.ts** - Multiple test functions with `page` parameter + - Line 4:65 + - Line 27:68 + - Line 39:54 + - Line 64:57 +4. **tests/e2e/landlord-messages.spec.ts** - Multiple test functions with `page` parameter + - Line 4:65 + - Line 29:73 +5. **tests/e2e/landlord-onboarding.spec.ts** - Multiple test functions with `page` parameter + - Line 4:70 + - Line 28:73 +6. **tests/e2e/multi-property.spec.ts:4:66** - Test function with `page` parameter +7. **tests/e2e/onboarding.spec.ts** - Multiple test functions with `page` parameter + - Line 4:75 + - Line 24:73 + - Line 44:62 + - Line 56:75 +8. **tests/e2e/reminders.spec.ts:4:68** - Test function with `page` parameter +9. **tests/e2e/tenant-dashboard.spec.ts** - Multiple test functions with `page` parameter + - Line 4:68 + - Line 18:67 + - Line 31:58 + - Line 50:68 + - Line 70:62 -1. **Import Statement Order** - Multiple files have incorrect import ordering -2. **Function Definition Formatting** - Functions not properly formatted - according to Deno standards -3. **Indentation Issues** - Inconsistent indentation in JSX components -4. **Line Break Issues** - Missing or extra line breaks in various files +## Required Actions -## E2E Test Failures (deno task e2e) +1. **Add proper TypeScript types for Playwright test parameters** + - Import Page type from `@playwright/test` + - Type the `page` parameter in all test functions + - Type the `id` parameter in helpers.ts -### Failed Tests +2. **Example fix pattern:** + ```typescript + import { Page, TestInfo } from '@playwright/test'; + + test("example test", async ({ page }: { page: Page }) => { + // test code + }); + ``` -1. **reminders.spec.ts:4** - "landlord can send reminder and tenant receives it" - - **Error**: Element with role "heading" and name matching /messages/i not - found - - **Expected**: Messages heading should be visible - - **Status**: Timeout after 5000ms - -2. **tenant-dashboard.spec.ts:50** - "tenant messages list shows landlord - communication" - - **Error**: Element with role "heading" and name matching /messages/i not - found - - **Expected**: Messages heading should be visible - - **Status**: Timeout after 5000ms - -### Test Infrastructure Issues - -- **Static File Serving Error**: Server crashes when trying to serve static - files - - Error: "Failed to read directory: No such file or directory (os error 2)" - - Path: `/Users/nanderson/nathanAndrinoid/cyberhybridhub.com/static` - - Impact: Tests failing due to missing static assets - -### Root Cause Analysis - -- Both failed tests are looking for a "Messages" heading that doesn't exist -- This suggests either: - - The messages page/component is not rendering properly - - The heading text or role attributes are incorrect - - The navigation to messages page is failing - -## Priority Actions - -### High Priority - -1. **Fix static file serving** - Create missing `/static` directory or fix - configuration -2. **Investigate messages page** - Check why messages heading is not rendering -3. **Run code formatting** - Execute `deno fmt` to fix all formatting issues - -### Medium Priority - -1. **Review test expectations** - Verify if test assertions match actual UI -2. **Check navigation flow** - Ensure users can properly navigate to messages -3. **Fix import statements** - Correct import order in affected files - -### Low Priority - -1. **Code style consistency** - Ensure all files follow consistent formatting -2. **Add error handling** - Improve error handling for missing static files - -## Next Steps - -1. Create `/static` directory if missing -2. Run `deno fmt` to fix formatting -3. Debug messages page rendering issue -4. Re-run tests to verify fixes -5. Address any remaining test failures +3. **Run deno check again after fixes to verify all errors resolved** \ No newline at end of file