feat: publish Regex Tools 0.2.0

This commit is contained in:
2026-07-27 01:06:57 +02:00
parent 873b9b218d
commit 4951c966d4
180 changed files with 35344 additions and 503 deletions

View File

@@ -240,6 +240,16 @@ describe("Workbench syntax coordination", () => {
fireEvent.click(screen.getByRole("checkbox", { name: "Live" }));
await advanceParseDebounce();
expect(syntaxHarness.patterns[0]?.request).toMatchObject({
flavour: "ecmascript",
flavourVersion: "2025",
flags: ["g", "u"],
options: {},
});
expect(
screen.getByRole("combobox", { name: "Flavour" }),
).not.toBeDisabled();
expect(screen.getByRole("combobox", { name: "Version" })).toBeDisabled();
await resolvePattern(0, [
{
number: 1,
@@ -308,6 +318,9 @@ describe("Workbench syntax coordination", () => {
});
expect(engineHarness.requests).toHaveLength(1);
expect(engineHarness.requests[0]).toMatchObject({
flavour: "ecmascript",
flavourVersion: "ECMAScript 2025 syntax / current browser runtime",
options: {},
pattern: "(?<new>b)",
captureMetadata: [{ number: 1, name: "new" }],
});
@@ -380,4 +393,47 @@ describe("Workbench syntax coordination", () => {
)?.cancelCalls,
).toBeGreaterThan(0);
});
it("opens the bounded subject minimizer with the current editor snapshot", () => {
vi.useFakeTimers();
render(<Workbench />);
fireEvent.click(screen.getByRole("button", { name: "Minimize" }));
expect(
screen.getByRole("heading", { name: "Minimize a reproducer" }),
).toBeVisible();
expect(screen.getByLabelText("Subject to minimize")).toHaveValue(
"2026-07-24 alice\nInvalid row\n2025-12-31 Bérénice",
);
expect(screen.getByLabelText("Minimization failure kind")).toHaveValue(
"unit-test-failure",
);
fireEvent.click(
screen.getByRole("button", { name: "Close subject minimizer" }),
);
expect(
screen.queryByRole("heading", { name: "Minimize a reproducer" }),
).not.toBeInTheDocument();
});
it("opens and closes the grammar-backed formatter workspace", () => {
vi.useFakeTimers();
render(<Workbench />);
fireEvent.click(screen.getByRole("button", { name: "Format" }));
expect(
screen.getByRole("heading", { name: "Format pattern" }),
).toBeVisible();
expect(
screen.getByText(/Wait for the ECMAScript syntax provider/),
).toBeVisible();
fireEvent.click(
screen.getByRole("button", { name: "Close pattern formatter" }),
);
expect(
screen.queryByRole("heading", { name: "Format pattern" }),
).not.toBeInTheDocument();
});
});