mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Adds signal testing to UI elements
Extends UI element tests to include signal emission verification. This ensures that UI elements correctly emit signals upon user interaction, improving the reliability and responsiveness of the UI. Adds QSignalSpy to track signal emissions for various UI components like buttons, checkboxes, comboboxes, items, sliders, textboxes and thermos.
This commit is contained in:
@@ -11,3 +11,11 @@ TEST(UI_combobox, to_from_json)
|
||||
EXPECT_EQ(combobox.bg_color(), combobox2.bg_color());
|
||||
EXPECT_EQ(combobox.selected(), combobox2.selected());
|
||||
}
|
||||
|
||||
TEST(UI_combobox, signal)
|
||||
{
|
||||
UI_combobox combobox(Color::Default, Color::Default, {"option1", "option2"});
|
||||
QSignalSpy spy(&combobox, &UI_combobox::changed);
|
||||
combobox.set_selected(1);
|
||||
EXPECT_EQ(spy.count(), 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user