






















@@ -225,8 +225,7 @@ describe("cron view", () => {
225225container,
226226);
227227228-const selected = container.querySelector(".list-item-selected");
229-expect(selected).not.toBeNull();
228+getElement(container, ".list-item-selected", HTMLElement);
230229231230const row = getElement(container, ".list-item-clickable", HTMLElement);
232231row.dispatchEvent(new MouseEvent("click", { bubbles: true }));
@@ -327,7 +326,7 @@ describe("cron view", () => {
327326expect(collapseButton.getAttribute("aria-expanded")).toBe("true");
328327collapseButton.dispatchEvent(new MouseEvent("click", { bubbles: true }));
329328expect(onToggleFormCollapsed).toHaveBeenCalledWith(true);
330-expect(container.querySelector(".cron-form")).not.toBeNull();
329+getElement(container, ".cron-form", HTMLElement);
331330332331const collapsedProps = createProps() as CronProps & {
333332cronFormCollapsed: boolean;
@@ -440,7 +439,7 @@ describe("cron view", () => {
440439441440const runBody = container.querySelector(".cron-run-entry__body.chat-text");
442441expect(runBody?.querySelector("strong")?.textContent).toBe("markdown");
443-expect(runBody?.querySelector("table")).not.toBeNull();
442+expect(runBody?.querySelectorAll("table")).toHaveLength(1);
444443});
445444446445it("shows run errors in one place when no summary exists", () => {
@@ -565,9 +564,8 @@ describe("cron view", () => {
565564expect(container.textContent).toContain("Execution");
566565expect(container.textContent).toContain("Delivery");
567566568-const checkboxLabel = container.querySelector(".cron-checkbox");
569-expect(checkboxLabel).not.toBeNull();
570-const firstElement = checkboxLabel?.firstElementChild;
567+const checkboxLabel = getElement(container, ".cron-checkbox", HTMLLabelElement);
568+const firstElement = checkboxLabel.firstElementChild;
571569expect(firstElement?.tagName.toLowerCase()).toBe("input");
572570573571render(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。