chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.

This commit is contained in:
cpojer
2026-01-31 16:03:28 +09:00
parent 481f696a87
commit 15792b153f
292 changed files with 643 additions and 699 deletions

View File

@@ -306,9 +306,9 @@ describe("browser control server", () => {
it("agent contract: navigation + common act commands", async () => {
const base = await startServerAndBase();
const nav = (await postJson(`${base}/navigate`, {
const nav = await postJson(`${base}/navigate`, {
url: "https://example.com",
})) as { ok: boolean; targetId?: string };
});
expect(nav.ok).toBe(true);
expect(typeof nav.targetId).toBe("string");
expect(pwMocks.navigateViaPlaywright).toHaveBeenCalledWith({
@@ -317,12 +317,12 @@ describe("browser control server", () => {
url: "https://example.com",
});
const click = (await postJson(`${base}/act`, {
const click = await postJson(`${base}/act`, {
kind: "click",
ref: "1",
button: "left",
modifiers: ["Shift"],
})) as { ok: boolean };
});
expect(click.ok).toBe(true);
expect(pwMocks.clickViaPlaywright).toHaveBeenNthCalledWith(1, {
cdpUrl: cdpBaseUrl,
@@ -343,11 +343,11 @@ describe("browser control server", () => {
/'selector' is not supported/i,
);
const type = (await postJson(`${base}/act`, {
const type = await postJson(`${base}/act`, {
kind: "type",
ref: "1",
text: "",
})) as { ok: boolean };
});
expect(type.ok).toBe(true);
expect(pwMocks.typeViaPlaywright).toHaveBeenNthCalledWith(1, {
cdpUrl: cdpBaseUrl,
@@ -358,10 +358,10 @@ describe("browser control server", () => {
slowly: false,
});
const press = (await postJson(`${base}/act`, {
const press = await postJson(`${base}/act`, {
kind: "press",
key: "Enter",
})) as { ok: boolean };
});
expect(press.ok).toBe(true);
expect(pwMocks.pressKeyViaPlaywright).toHaveBeenCalledWith({
cdpUrl: cdpBaseUrl,
@@ -369,10 +369,10 @@ describe("browser control server", () => {
key: "Enter",
});
const hover = (await postJson(`${base}/act`, {
const hover = await postJson(`${base}/act`, {
kind: "hover",
ref: "2",
})) as { ok: boolean };
});
expect(hover.ok).toBe(true);
expect(pwMocks.hoverViaPlaywright).toHaveBeenCalledWith({
cdpUrl: cdpBaseUrl,
@@ -380,10 +380,10 @@ describe("browser control server", () => {
ref: "2",
});
const scroll = (await postJson(`${base}/act`, {
const scroll = await postJson(`${base}/act`, {
kind: "scrollIntoView",
ref: "2",
})) as { ok: boolean };
});
expect(scroll.ok).toBe(true);
expect(pwMocks.scrollIntoViewViaPlaywright).toHaveBeenCalledWith({
cdpUrl: cdpBaseUrl,
@@ -391,11 +391,11 @@ describe("browser control server", () => {
ref: "2",
});
const drag = (await postJson(`${base}/act`, {
const drag = await postJson(`${base}/act`, {
kind: "drag",
startRef: "3",
endRef: "4",
})) as { ok: boolean };
});
expect(drag.ok).toBe(true);
expect(pwMocks.dragViaPlaywright).toHaveBeenCalledWith({
cdpUrl: cdpBaseUrl,