mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-27 21:02:23 +00:00
test(automation): MockUiBackend recording test double
This commit is contained in:
13
tests/automation/MockUiBackend.cpp
Normal file
13
tests/automation/MockUiBackend.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "MockUiBackend.hpp"
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
using namespace Slic3r::GUI::Automation;
|
||||
|
||||
TEST_CASE("MockUiBackend records calls", "[automation][mock]") {
|
||||
MockUiBackend mock;
|
||||
UiNode n; n.id = "btn_slice";
|
||||
mock.click(n, MouseButton::Left, false, {});
|
||||
REQUIRE(mock.clicked_ids.size() == 1);
|
||||
CHECK(mock.clicked_ids[0] == "btn_slice");
|
||||
CHECK(mock.click_buttons[0] == MouseButton::Left);
|
||||
}
|
||||
Reference in New Issue
Block a user