дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
A page session gets a Network tab in the Debug tool window: the page's requests with status, method, type, size and time, filtered by URL, resource kind and My code only (a request sent through a library is attributed to the project code that called it). A request shows its headers, response body (text, cut at 1 MB) and initiator; Break on Next Request turns it into a request breakpoint, and Reload Page loads the page again. js-debug's enableNetworking is asked once the page's launch is answered; a js-debug that doesn't report requests says so in the tab. Co-authored-by: ntbang0901 <[email protected]>
24 рядки
977 B
TypeScript
24 рядки
977 B
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
import { act, render, screen } from "@testing-library/react";
|
|
import { EventBreakpointsSection } from "../js/EventBreakpointsSection";
|
|
import { forgetRefusals, setRefused } from "../js/refusals";
|
|
|
|
afterEach(() => forgetRefusals(4));
|
|
|
|
describe("JavaScript events and requests section", () => {
|
|
it("says so when the debugger of a page does not take these breakpoints", () => {
|
|
render(<EventBreakpointsSection />);
|
|
expect(screen.queryByRole("alert")).toBeNull();
|
|
act(() => setRefused(4, "eventBreakpoints", "unknown request"));
|
|
expect(screen.getByRole("alert")).toHaveTextContent(
|
|
"The debugger of the running page does not take these breakpoints: unknown request",
|
|
);
|
|
// Another tool's refusal is not about breakpoints.
|
|
act(() => {
|
|
setRefused(4, "eventBreakpoints", null);
|
|
setRefused(4, "network", "");
|
|
});
|
|
expect(screen.queryByRole("alert")).toBeNull();
|
|
});
|
|
});
|