test: expand test coverage across all layers (+1,157 tests)

Fix 2 failing unit tests (landing hero text mismatch) and broken
coverage tooling (brace-expansion v5 override breaking minimatch).
Add ~1,097 new test cases via 14-agent parallel expansion:

- Unit: +290 tests (AI bridge, image-engine, stores, API helpers)
- Integration: +504 tests (all tools, cross-format matrix, adversarial)
- E2E: +363 tests (navigation, tool UI, batch/pipeline, settings,
  visual regression, accessibility, performance, cross-browser)

Total: 4,223 unit + 6,057 integration + 1,563 E2E = 11,843 tests
This commit is contained in:
SnapOtter
2026-06-06 19:37:29 +08:00
parent 66e503730d
commit 06d1822491
67 changed files with 20114 additions and 49 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
// @vitest-environment jsdom
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";
import { Dropzone, isImageFile } from "@/components/common/dropzone";
afterEach(() => {
@@ -205,7 +205,7 @@ describe("Dropzone", () => {
render(<Dropzone />);
fireEvent.click(screen.getByLabelText("File drop zone"));
expect(getInput()!.multiple).toBe(true);
expect(getInput()?.multiple).toBe(true);
});
it("disables multiple when multiple=false", () => {
@@ -213,7 +213,7 @@ describe("Dropzone", () => {
render(<Dropzone multiple={false} />);
fireEvent.click(screen.getByLabelText("File drop zone"));
expect(getInput()!.multiple).toBe(false);
expect(getInput()?.multiple).toBe(false);
});
it("sets accept attribute when accept prop is provided", () => {
@@ -237,7 +237,7 @@ describe("Dropzone", () => {
const file = makeFile("photo.png");
Object.defineProperty(input, "files", { value: [file], configurable: true });
input.onchange!({ target: input } as unknown as Event);
input.onchange?.({ target: input } as unknown as Event);
expect(onFiles).toHaveBeenCalledWith([file]);
});
@@ -252,7 +252,7 @@ describe("Dropzone", () => {
const files = [makeFile("a.png"), makeFile("b.jpg", "image/jpeg")];
Object.defineProperty(input, "files", { value: files, configurable: true });
input.onchange!({ target: input } as unknown as Event);
input.onchange?.({ target: input } as unknown as Event);
expect(onFiles).toHaveBeenCalledWith(files);
});
@@ -266,7 +266,7 @@ describe("Dropzone", () => {
const input = getInput()!;
Object.defineProperty(input, "files", { value: [], configurable: true });
input.onchange!({ target: input } as unknown as Event);
input.onchange?.({ target: input } as unknown as Event);
expect(onFiles).not.toHaveBeenCalled();
});