Upload folder using huggingface_hub
Browse files
6.12.0/tootils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "@self/tootils",
|
| 3 |
-
"version": "0.
|
| 4 |
"description": "Internal test utilities",
|
| 5 |
"type": "module",
|
| 6 |
"main": "src/index.ts",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "@self/tootils",
|
| 3 |
+
"version": "0.13.0",
|
| 4 |
"description": "Internal test utilities",
|
| 5 |
"type": "module",
|
| 6 |
"main": "src/index.ts",
|
6.12.0/tootils/src/shared-prop-tests.ts
CHANGED
|
@@ -35,6 +35,13 @@ export interface SharedPropTestConfig {
|
|
| 35 |
* @default false
|
| 36 |
*/
|
| 37 |
visible_false_hides?: boolean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
export function run_shared_prop_tests(config: SharedPropTestConfig): void {
|
|
@@ -44,7 +51,8 @@ export function run_shared_prop_tests(config: SharedPropTestConfig): void {
|
|
| 44 |
name,
|
| 45 |
has_label = true,
|
| 46 |
has_validation_error = true,
|
| 47 |
-
visible_false_hides = false
|
|
|
|
| 48 |
} = config;
|
| 49 |
|
| 50 |
const label = "Test Label";
|
|
@@ -84,9 +92,11 @@ export function run_shared_prop_tests(config: SharedPropTestConfig): void {
|
|
| 84 |
test("visible: true renders the component", async () => {
|
| 85 |
const { container } = await render(
|
| 86 |
component,
|
| 87 |
-
make_props({ visible: true })
|
| 88 |
);
|
| 89 |
-
const el =
|
|
|
|
|
|
|
| 90 |
expect(el).not.toBeNull();
|
| 91 |
});
|
| 92 |
|
|
|
|
| 35 |
* @default false
|
| 36 |
*/
|
| 37 |
visible_false_hides?: boolean;
|
| 38 |
+
/**
|
| 39 |
+
* Whether the component is wrapped in a Block (which renders a `.block`
|
| 40 |
+
* element). Components like Button render a bare element instead.
|
| 41 |
+
* Set to false to skip `.block` selector checks.
|
| 42 |
+
* @default true
|
| 43 |
+
*/
|
| 44 |
+
has_block_wrapper?: boolean;
|
| 45 |
}
|
| 46 |
|
| 47 |
export function run_shared_prop_tests(config: SharedPropTestConfig): void {
|
|
|
|
| 51 |
name,
|
| 52 |
has_label = true,
|
| 53 |
has_validation_error = true,
|
| 54 |
+
visible_false_hides = false,
|
| 55 |
+
has_block_wrapper = true
|
| 56 |
} = config;
|
| 57 |
|
| 58 |
const label = "Test Label";
|
|
|
|
| 92 |
test("visible: true renders the component", async () => {
|
| 93 |
const { container } = await render(
|
| 94 |
component,
|
| 95 |
+
make_props({ visible: true, elem_id: "visible-test" })
|
| 96 |
);
|
| 97 |
+
const el = has_block_wrapper
|
| 98 |
+
? container.querySelector(".block")
|
| 99 |
+
: container.querySelector("#visible-test");
|
| 100 |
expect(el).not.toBeNull();
|
| 101 |
});
|
| 102 |
|