mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-26 18:06:26 +00:00
37 lines
1.1 KiB
Text
37 lines
1.1 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
import { GroupBox } from "std-widgets.slint";
|
|
|
|
export component TestCase inherits Window {
|
|
|
|
gb := GroupBox {
|
|
title: "Group Title";
|
|
}
|
|
|
|
gb-disabled := GroupBox {
|
|
title: "Disabled Group";
|
|
enabled: false;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
```rust
|
|
use i_slint_backend_testing::AccessibleRole;
|
|
use slint::SharedString;
|
|
|
|
let instance = TestCase::new().unwrap();
|
|
|
|
let mut gb_search = slint_testing::ElementHandle::find_by_element_id(&instance, "TestCase::gb");
|
|
let gb = gb_search.next().unwrap();
|
|
|
|
assert_eq!(gb.accessible_role(), Some(AccessibleRole::Groupbox));
|
|
assert_eq!(gb.accessible_label(), Some(SharedString::from("Group Title")));
|
|
assert_eq!(gb.accessible_enabled(), Some(true));
|
|
|
|
let mut gb_disabled_search = slint_testing::ElementHandle::find_by_element_id(&instance, "TestCase::gb-disabled");
|
|
let gb_disabled = gb_disabled_search.next().unwrap();
|
|
assert_eq!(gb_disabled.accessible_enabled(), Some(false));
|
|
```
|
|
*/
|