Merge pull request #13 from nathanAndrinoid/open-swe/1f965eea-1d18-44d6-bd43-a0c4ca0d7edd

[WIP]: Fix TS7031 implicit any errors in Playwright E2E tests by adding explicit Page and string types.
This commit is contained in:
nathanAndrinoid 2026-01-20 14:05:44 -06:00 committed by GitHub
commit 7e8032e512
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 32 additions and 24 deletions

View File

@ -60,6 +60,9 @@ LOCAL_DEV_MODE="true"
sudo mv deno /usr/local/bin/ sudo mv deno /usr/local/bin/
rm deno-x86_64-unknown-linux-gnu.zip 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.
2. Clone repository and navigate to project directory 2. Clone repository and navigate to project directory
3. Set up environment variables (copy `.env.example` to `.env`) 3. Set up environment variables (copy `.env.example` to `.env`)
4. Start development server: `deno task dev` (Deno KV initializes automatically) 4. Start development server: `deno task dev` (Deno KV initializes automatically)
@ -151,3 +154,4 @@ LOCAL_DEV_MODE="true"
- Follow OWASP security guidelines - Follow OWASP security guidelines
- Use local authentication to avoid external dependencies - Use local authentication to avoid external dependencies
- Regular security audits and dependency updates - Regular security audits and dependency updates

Binary file not shown.

View File

@ -79,7 +79,7 @@ export async function useE2EUser(page: Page, userKey: string) {
tenant: "e2e-tenant-1", tenant: "e2e-tenant-1",
}; };
const userId = userIdMap[userKey] ?? userKey; const userId = userIdMap[userKey] ?? userKey;
await page.addInitScript(({ id }) => { await page.addInitScript(({ id }: { id: string }) => {
(window as { __E2E_SKIP_ENCRYPTION__?: boolean }).__E2E_SKIP_ENCRYPTION__ = (window as { __E2E_SKIP_ENCRYPTION__?: boolean }).__E2E_SKIP_ENCRYPTION__ =
true; true;
const skipKey = `realestate_app_skip_user_${id}`; const skipKey = `realestate_app_skip_user_${id}`;

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts";
test("landlord can generate a tenant invite email", async ({ page }) => { test("landlord can generate a tenant invite email", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -74,7 +74,7 @@ test("landlord can generate a tenant invite email", async ({ page }) => {
await expect(emailInput).toHaveValue(/jamie\.roommate@example\.com/i); await expect(emailInput).toHaveValue(/jamie\.roommate@example\.com/i);
}); });
test("tenant invite preview shows property details and actions", async ({ page }) => { test("tenant invite preview shows property details and actions", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
const inviteResponse = await page.request.post("/api/update/tenant_invite", { const inviteResponse = await page.request.post("/api/update/tenant_invite", {
@ -102,3 +102,4 @@ test("tenant invite preview shows property details and actions", async ({ page }
await expect(page.getByRole("button", { name: /decline/i })).toBeVisible(); await expect(page.getByRole("button", { name: /decline/i })).toBeVisible();
await expect(page.getByRole("link", { name: /cancel/i })).toBeVisible(); await expect(page.getByRole("link", { name: /cancel/i })).toBeVisible();
}); });

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord dashboard surfaces portfolio activity", async ({ page }) => { test("landlord dashboard surfaces portfolio activity", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -24,7 +24,7 @@ test("landlord dashboard surfaces portfolio activity", async ({ page }) => {
).toBeVisible(); ).toBeVisible();
}); });
test("landlord properties list includes active listings", async ({ page }) => { test("landlord properties list includes active listings", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -36,7 +36,7 @@ test("landlord properties list includes active listings", async ({ page }) => {
await expect(page.getByText("456 Maple St")).toBeVisible(); await expect(page.getByText("456 Maple St")).toBeVisible();
}); });
test("landlord can approve an application", async ({ page }) => { test("landlord can approve an application", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -61,7 +61,7 @@ test("landlord can approve an application", async ({ page }) => {
await expect(updatedRow).toContainText(/approved/i); await expect(updatedRow).toContainText(/approved/i);
}); });
test("landlord can update maintenance status", async ({ page }) => { test("landlord can update maintenance status", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -75,3 +75,4 @@ test("landlord can update maintenance status", async ({ page }) => {
await expect(page).toHaveURL(/\/landlord\/maintenance/); await expect(page).toHaveURL(/\/landlord\/maintenance/);
await expect(statusSelect).toHaveValue("in_progress"); await expect(statusSelect).toHaveValue("in_progress");
}); });

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord messages view paginates conversations", async ({ page }) => { test("landlord messages view paginates conversations", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -26,7 +26,7 @@ test("landlord messages view paginates conversations", async ({ page }) => {
await expect(page.getByText(/page 2 of 2/i)).toBeVisible(); await expect(page.getByText(/page 2 of 2/i)).toBeVisible();
}); });
test("landlord messages view filters unread inbound messages", async ({ page }) => { test("landlord messages view filters unread inbound messages", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord profile setup advances to property details", async ({ page }) => { test("landlord profile setup advances to property details", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord-onboarding"); await useE2EUser(page, "landlord-onboarding");
@ -25,7 +25,7 @@ test("landlord profile setup advances to property details", async ({ page }) =>
).toBeVisible(); ).toBeVisible();
}); });
test("property setup submits and lands on landlord dashboard", async ({ page }) => { test("property setup submits and lands on landlord dashboard", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord-onboarding"); await useE2EUser(page, "landlord-onboarding");
@ -49,3 +49,4 @@ test("property setup submits and lands on landlord dashboard", async ({ page })
await expect(page.getByRole("heading", { name: /landlord dashboard/i })) await expect(page.getByRole("heading", { name: /landlord dashboard/i }))
.toBeVisible(); .toBeVisible();
}); });

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord sees multi-property portfolio overview", async ({ page }) => { test("landlord sees multi-property portfolio overview", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, e2eHeaders, useE2EUser } from "./helpers.ts";
test("tenant onboarding lets renters apply and reach dashboard", async ({ page }) => { test("tenant onboarding lets renters apply and reach dashboard", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "tenant"); await useE2EUser(page, "tenant");
@ -21,7 +21,7 @@ test("tenant onboarding lets renters apply and reach dashboard", async ({ page }
.toBeVisible(); .toBeVisible();
}); });
test("landlord onboarding entry points show dashboard access", async ({ page }) => { test("landlord onboarding entry points show dashboard access", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -41,7 +41,7 @@ test("landlord onboarding entry points show dashboard access", async ({ page })
).toBeVisible(); ).toBeVisible();
}); });
test("onboarded landlord skips profile onboarding", async ({ page }) => { test("onboarded landlord skips profile onboarding", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");
@ -53,7 +53,7 @@ test("onboarded landlord skips profile onboarding", async ({ page }) => {
await expect(page.getByLabel(/street address/i)).toBeVisible(); await expect(page.getByLabel(/street address/i)).toBeVisible();
}); });
test("invite links highlight the selected rental on onboarding", async ({ page }) => { test("invite links highlight the selected rental on onboarding", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
const inviteResponse = await page.request.post("/api/update/tenant_invite", { const inviteResponse = await page.request.post("/api/update/tenant_invite", {
@ -77,3 +77,4 @@ test("invite links highlight the selected rental on onboarding", async ({ page }
await expect(page.getByText("Skyline Lofts")).toBeVisible(); await expect(page.getByText("Skyline Lofts")).toBeVisible();
await expect(page.getByLabel(/select a property/i)).toHaveCount(0); await expect(page.getByLabel(/select a property/i)).toHaveCount(0);
}); });

View File

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test"; import { expect, test, Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts"; import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord can send reminder and tenant receives it", async ({ page }) => { test("landlord can send reminder and tenant receives it", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page); await applyDeterministicPage(page);
await useE2EUser(page, "landlord"); await useE2EUser(page, "landlord");