2023-06-20 02:53:35 +08:00
|
|
|
import { test, describe, assert, afterEach, vi } from "vitest";
|
|
|
|
import { cleanup, render } from "@gradio/tootils";
|
|
|
|
|
2023-08-04 06:01:18 +08:00
|
|
|
import Group from "./static";
|
2023-06-20 02:53:35 +08:00
|
|
|
|
|
|
|
describe("Group", () => {
|
|
|
|
afterEach(() => {
|
|
|
|
cleanup();
|
|
|
|
});
|
|
|
|
|
|
|
|
test("setting visible to false hides the Group", async () => {
|
|
|
|
render(Group, {
|
|
|
|
elem_id: "group",
|
|
|
|
visible: false
|
|
|
|
});
|
|
|
|
|
|
|
|
const groupElement = document.getElementById("group");
|
|
|
|
|
|
|
|
assert(groupElement !== null, "Group element not found.");
|
|
|
|
assert(
|
|
|
|
groupElement.classList.contains("hide"),
|
|
|
|
"Group element is not hidden."
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|