adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
import { test, describe, afterEach, expect } from "vitest";
|
|
import { cleanup, render } from "@self/tootils/render";
|
|
import { run_shared_prop_tests } from "@self/tootils/shared-prop-tests";
|
|
|
|
import Box from "./Index.svelte";
|
|
|
|
// Box is a layout container with no label, value, events, or validation.
|
|
// All meaningful props (elem_id, elem_classes, visible) are shared props.
|
|
run_shared_prop_tests({
|
|
component: Box,
|
|
name: "Box",
|
|
base_props: {},
|
|
has_label: false,
|
|
has_validation_error: false
|
|
});
|
|
|
|
describe("Box", () => {
|
|
afterEach(() => cleanup());
|
|
|
|
test("renders without props", async () => {
|
|
const { container } = await render(Box, {});
|
|
// No role, label, or text available on a bare layout container —
|
|
// querySelector(".block") is the appropriate query here.
|
|
const block = container.querySelector(".block");
|
|
expect(block).not.toBeNull();
|
|
});
|
|
|
|
test("renders with props", async () => {
|
|
const { container } = await render(Box, {
|
|
elem_id: "my-box",
|
|
elem_classes: ["my-class"],
|
|
visible: true
|
|
});
|
|
const block = container.querySelector("#my-box.my-class");
|
|
expect(block).not.toBeNull();
|
|
});
|
|
|
|
test.todo(
|
|
"VISUAL: Box renders with full block styling (padding, border, background, shadow) because explicit_call is always passed to Block — needs Playwright visual regression screenshot"
|
|
);
|
|
|
|
test.todo(
|
|
"VISUAL: Box container never enters hide-container mode (transparent, no border, no padding) — explicit_call prevents this regardless of container prop — needs Playwright visual regression screenshot"
|
|
);
|
|
|
|
test.todo(
|
|
"VISUAL: slot content renders inside the block container — needs integration test mounting Box with real child Gradio components as slot content"
|
|
);
|
|
});
|