diff --git a/AGENTS.md b/AGENTS.md index 91c4a85..76955ce 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -61,7 +61,9 @@ LOCAL_DEV_MODE="true" rm deno-x86_64-unknown-linux-gnu.zip ``` -Ensure the `deno` executable is available in your system's PATH. The above instructions place it in `/usr/local/bin/`, which is typically included in the PATH. +Ensure the `deno` executable is available in your system's PATH. The above +instructions place it in `/usr/local/bin/`, which is typically included in the +PATH. 2. Clone repository and navigate to project directory 3. Set up environment variables (copy `.env.example` to `.env`) @@ -81,7 +83,9 @@ Ensure the `deno` executable is available in your system's PATH. The above instr 2. Run `deno task check` to validate code quality 3. Test with `deno task test` and `deno task e2e` 4. Deno KV handles data persistence automatically -5. **File-Level Validation**: When coding, ensure compliance by running the following commands on the specific file being modified (replace `routes/index.tsx` with your file path): +5. **File-Level Validation**: When coding, ensure compliance by running the + following commands on the specific file being modified (replace + `routes/index.tsx` with your file path): ```bash deno check routes/index.tsx deno fmt routes/index.tsx @@ -154,4 +158,3 @@ Ensure the `deno` executable is available in your system's PATH. The above instr - Follow OWASP security guidelines - Use local authentication to avoid external dependencies - Regular security audits and dependency updates - diff --git a/TODO.md b/TODO.md index 37b41a6..fd9213a 100644 --- a/TODO.md +++ b/TODO.md @@ -3,11 +3,14 @@ ## TypeScript Errors Found (34 total) ### Primary Issue: Missing Playwright Dependency -Multiple files have `TS2307: Import "@playwright/test" not a dependency and not in import map` + +Multiple files have +`TS2307: Import "@playwright/test" not a dependency and not in import map` **Affected Files:** + - tests/e2e/document-api.spec.ts:1:36 -- tests/e2e/documents.spec.ts:1:36 +- tests/e2e/documents.spec.ts:1:36 - tests/e2e/financial-api.spec.ts:1:36 - tests/e2e/financial-ui.spec.ts:1:36 - tests/e2e/guest-home.spec.ts:1:36 @@ -22,19 +25,23 @@ Multiple files have `TS2307: Import "@playwright/test" not a dependency and not - tests/e2e/tenant-dashboard.spec.ts:1:36 ### Secondary Issue: Implicit Any Types + `TS7031: Binding element` errors for untyped parameters: **Files with untyped `page` parameter:** + - tests/e2e/documents.spec.ts (lines 4:61, 29:63) - tests/e2e/financial-ui.spec.ts (lines 4:60, 19:71) - tests/e2e/guest-home.spec.ts (lines 4:26, 8:62, 24:58) - tests/e2e/tenant-dashboard.spec.ts (lines 4:68, 18:67, 31:58, 50:68, 70:62) **Files with untyped `request` parameter:** + - tests/e2e/document-api.spec.ts (lines 4:75, 70:78) - tests/e2e/financial-api.spec.ts (lines 4:68, 19:59, 40:65, 76:66) **Files with other untyped parameters:** + - tests/e2e/helpers.ts:7:8 - `({ now })` parameter - tests/e2e/helpers.ts:82:31 - `({ id })` parameter @@ -51,12 +58,12 @@ Multiple files have `TS2307: Import "@playwright/test" not a dependency and not 3. **Example fix pattern:** ```typescript - import { Page, Request, TestInfo } from '@playwright/test'; - + import { Page, Request, TestInfo } from "@playwright/test"; + test("example test", async ({ page }: { page: Page }) => { // test code }); - + test("api test", async ({ request }: { request: Request }) => { // test code }); @@ -65,4 +72,4 @@ Multiple files have `TS2307: Import "@playwright/test" not a dependency and not 4. **Run deno check again after fixes to verify all errors resolved:** ```bash deno check 2>&1 | head -c 5000 - ``` \ No newline at end of file + ``` diff --git a/deno.json b/deno.json index dbec6cb..ea4c61c 100755 --- a/deno.json +++ b/deno.json @@ -45,7 +45,7 @@ "gcs": "https://deno.land/x/google_cloud_storage/mod.ts", "google-cloud-storage": "npm:@google-cloud/storage", "gLog": "npm:google-logging-utils", - "cosmos": "npm:@azure/cosmos" + "cosmos": "npm:@azure/cosmos", "@playwright/test": "npm:@playwright/test" }, "compilerOptions": { diff --git a/routes/tenant/settings/index.tsx b/routes/tenant/settings/index.tsx index f0cd4a3..1b400d3 100644 --- a/routes/tenant/settings/index.tsx +++ b/routes/tenant/settings/index.tsx @@ -61,46 +61,45 @@ export default define.page(function TenantSettingsPage({ }: { data: SettingsPageData; }) { - const { user, error } = data as SettingsPageData; - - if (error) { - return ( -
-
-

Error

-

{error}

- -
-
- ); - } + const { user, error } = data as SettingsPageData; + if (error) { return ( -
- {/* Header */} -
-
-
-

Tenant Settings

-

- Manage your notification and payment preferences. -

-
+
+
+

Error

+

{error}

+
- - {/* Main Content */} -
- -
); - }, -); + } + + return ( +
+ {/* Header */} +
+
+
+

Tenant Settings

+

+ Manage your notification and payment preferences. +

+
+
+
+ + {/* Main Content */} +
+ +
+
+ ); +}); diff --git a/tests/e2e/document-api.spec.ts b/tests/e2e/document-api.spec.ts index 80c35e7..b4b3148 100644 --- a/tests/e2e/document-api.spec.ts +++ b/tests/e2e/document-api.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type APIRequestContext } from "@playwright/test"; +import { type APIRequestContext, expect, test } from "@playwright/test"; import { e2eHeaders } from "./helpers.ts"; test("lease document API supports create, retrieve, and delete", async ({ request }: { request: APIRequestContext }) => { diff --git a/tests/e2e/documents.spec.ts b/tests/e2e/documents.spec.ts index 66c724b..114aaf8 100644 --- a/tests/e2e/documents.spec.ts +++ b/tests/e2e/documents.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type Page } from "@playwright/test"; +import { expect, type Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("tenant can review and sign lease documents", async ({ page }: { page: Page }) => { @@ -54,4 +54,3 @@ test("landlord can review and sign lease documents", async ({ page }: { page: Pa }).first(); await expect(updatedRow).toContainText("Signed"); }); - diff --git a/tests/e2e/financial-api.spec.ts b/tests/e2e/financial-api.spec.ts index 2813d78..8d1fd35 100644 --- a/tests/e2e/financial-api.spec.ts +++ b/tests/e2e/financial-api.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type APIRequestContext } from "@playwright/test"; +import { type APIRequestContext, expect, test } from "@playwright/test"; import { e2eHeaders } from "./helpers.ts"; test("tenant payment methods API returns default method", async ({ request }: { request: APIRequestContext }) => { diff --git a/tests/e2e/financial-ui.spec.ts b/tests/e2e/financial-ui.spec.ts index 6ea381b..0d7e6c1 100644 --- a/tests/e2e/financial-ui.spec.ts +++ b/tests/e2e/financial-ui.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type Page } from "@playwright/test"; +import { expect, type Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("tenant payment history surfaces late fees", async ({ page }: { page: Page }) => { @@ -35,4 +35,3 @@ test("landlord rent collection highlights overdue payments", async ({ page }: { await expect(overdueCard).toContainText("1"); await expect(lateFeeCard).toContainText("$50"); }); - diff --git a/tests/e2e/guest-home.spec.ts b/tests/e2e/guest-home.spec.ts index 328a42e..4a79d1a 100644 --- a/tests/e2e/guest-home.spec.ts +++ b/tests/e2e/guest-home.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type Page } from "@playwright/test"; +import { expect, type Page, test } from "@playwright/test"; import { applyDeterministicPage } from "./helpers.ts"; test.beforeEach(async ({ page }) => { @@ -32,4 +32,3 @@ test("guest landing shows system ready banner", async ({ page }: { page: Page }) page.locator("form[action='/auth/login']").filter({ hasText: "ENTER" }), ).toBeVisible(); }); - diff --git a/tests/e2e/invite-tenant.spec.ts b/tests/e2e/invite-tenant.spec.ts index 653b64c..757b2e0 100644 --- a/tests/e2e/invite-tenant.spec.ts +++ b/tests/e2e/invite-tenant.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts"; test("landlord can generate a tenant invite email", async ({ page }: { page: Page }) => { @@ -102,4 +102,3 @@ test("tenant invite preview shows property details and actions", async ({ page } await expect(page.getByRole("button", { name: /decline/i })).toBeVisible(); await expect(page.getByRole("link", { name: /cancel/i })).toBeVisible(); }); - diff --git a/tests/e2e/landlord-dashboard.spec.ts b/tests/e2e/landlord-dashboard.spec.ts index 3b1c770..267f401 100644 --- a/tests/e2e/landlord-dashboard.spec.ts +++ b/tests/e2e/landlord-dashboard.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord dashboard surfaces portfolio activity", async ({ page }: { page: Page }) => { @@ -75,4 +75,3 @@ test("landlord can update maintenance status", async ({ page }: { page: Page }) await expect(page).toHaveURL(/\/landlord\/maintenance/); await expect(statusSelect).toHaveValue("in_progress"); }); - diff --git a/tests/e2e/landlord-messages.spec.ts b/tests/e2e/landlord-messages.spec.ts index 6e2bed4..eee92ee 100644 --- a/tests/e2e/landlord-messages.spec.ts +++ b/tests/e2e/landlord-messages.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord messages view paginates conversations", async ({ page }: { page: Page }) => { diff --git a/tests/e2e/landlord-onboarding.spec.ts b/tests/e2e/landlord-onboarding.spec.ts index 5039de8..26760ee 100644 --- a/tests/e2e/landlord-onboarding.spec.ts +++ b/tests/e2e/landlord-onboarding.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord profile setup advances to property details", async ({ page }: { page: Page }) => { @@ -49,4 +49,3 @@ test("property setup submits and lands on landlord dashboard", async ({ page }: await expect(page.getByRole("heading", { name: /landlord dashboard/i })) .toBeVisible(); }); - diff --git a/tests/e2e/multi-property.spec.ts b/tests/e2e/multi-property.spec.ts index 6c23457..d38a84b 100644 --- a/tests/e2e/multi-property.spec.ts +++ b/tests/e2e/multi-property.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord sees multi-property portfolio overview", async ({ page }: { page: Page }) => { diff --git a/tests/e2e/onboarding.spec.ts b/tests/e2e/onboarding.spec.ts index 9fdfd51..b027611 100644 --- a/tests/e2e/onboarding.spec.ts +++ b/tests/e2e/onboarding.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts"; test("tenant onboarding lets renters apply and reach dashboard", async ({ page }: { page: Page }) => { @@ -77,4 +77,3 @@ test("invite links highlight the selected rental on onboarding", async ({ page } await expect(page.getByText("Skyline Lofts")).toBeVisible(); await expect(page.getByLabel(/select a property/i)).toHaveCount(0); }); - diff --git a/tests/e2e/reminders.spec.ts b/tests/e2e/reminders.spec.ts index 4942c9a..b60ba0d 100644 --- a/tests/e2e/reminders.spec.ts +++ b/tests/e2e/reminders.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("landlord can send reminder and tenant receives it", async ({ page }: { page: Page }) => { diff --git a/tests/e2e/tenant-dashboard.spec.ts b/tests/e2e/tenant-dashboard.spec.ts index 30a976f..c7dae26 100644 --- a/tests/e2e/tenant-dashboard.spec.ts +++ b/tests/e2e/tenant-dashboard.spec.ts @@ -1,4 +1,4 @@ -import { expect, test, type Page } from "@playwright/test"; +import { expect, type Page, test } from "@playwright/test"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; test("tenant dashboard shows lease summary and activity", async ({ page }: { page: Page }) => { @@ -81,4 +81,3 @@ test("tenant rent pay flow accepts payment method", async ({ page }: { page: Pag await submitButton.click(); await expect(page).toHaveURL(/\/tenant\/rent\/confirmation\?success=true/); }); -