hyapp-admin-platform/external-admin/src/components/BannerCreateDialog.test.jsx

21 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { describe, expect, test, vi } from "vitest";
import { BannerCreateDialog } from "./BannerCreateDialog.jsx";
describe("BannerCreateDialog", () => {
test("uses the shared structured app jump field and unified time range picker", async () => {
const user = userEvent.setup();
render(<BannerCreateDialog open onClose={vi.fn()} onSubmit={vi.fn()} />);
expect(screen.getByRole("textbox", { name: "参数H5 链接)" })).toBeInTheDocument();
expect(screen.getByText("投放时间")).toBeInTheDocument();
await user.click(screen.getByRole("combobox", { name: "跳转类型" }));
await user.click(await screen.findByRole("option", { name: "APP" }));
expect(screen.getByRole("combobox", { name: "APP 目标" })).toBeInTheDocument();
expect(screen.getByRole("textbox", { name: "参数APP 公共跳转 JSON" })).toHaveValue(JSON.stringify({ type: "wallet" }));
});
});