Simplify spinbox test

Replace dummy accessible-label use with the new element id lookup mechanism for testing.
This commit is contained in:
Simon Hausmann 2024-05-17 15:40:24 +02:00 committed by Simon Hausmann
parent a752851d0f
commit c27cbb94a6
2 changed files with 3 additions and 3 deletions

View file

@ -54,7 +54,6 @@ export component SpinBoxBase {
accessible-role: AccessibleRole.text-input;
accessible-value: self.text;
accessible-label: "spinbox-textinput";
accepted => {
if !self.text.is-float() {

View file

@ -9,7 +9,8 @@ import { SpinBox } from "std-widgets.slint";
export component TestCase inherits Window {
width: 100px;
height: 100px;
box := SpinBox {}
box := SpinBox { }
forward-focus: box;
out property <bool> spinbox-focused <=> box.has_focus;
callback edited <=> box.edited;
@ -87,7 +88,7 @@ edits.borrow_mut().clear();
instance.set_value(30);
mock_elapsed_time(500);
let mut text_input_search = slint_testing::ElementHandle::find_by_accessible_label(&instance, "spinbox-textinput");
let mut text_input_search = slint_testing::ElementHandle::find_by_element_id(&instance, "SpinBoxBase::text-input");
let text_input = text_input_search.next().unwrap();
assert_eq!(text_input.accessible_value().unwrap(), "30");
edits.borrow_mut().clear();