Bind confirmed bank and ticket actions to real careers (by Codex)

This commit is contained in:
Codex committed 2026-10-28 11:04:11 +01:00
1 parent f75e0f8e49
commit dcf42f2da7
23 files changed
+535 -56

No files matched your search

+14
View File
@@ -191,6 +191,20 @@ int main(int argc, char **argv) try {
CHECK(!popup.open(anchor, 1, 2, 25, 2));
CHECK(!popup.is_open());
}
{
// An async owner accepts a proposal without optimistically publishing it.
source.s.state["ticket"] = 20;
int proposals = 0; Action staged;
TicketPopover popup(*context, *doc, [&] { return source.snapshot(); },
[&](const Action &a) { ++proposals; staged = a; return ActionResult{true, source.s.revision, {}}; }, [] {});
CHECK(popup.open(doc->GetElementById("desktop-ticket"), 1, 8, 25));
Rml::Dictionary k; k["key_identifier"] = int(Rml::Input::KI_END);
doc->GetElementById("native-ticket-range")->DispatchEvent("keydown", k);
doc->QuerySelector("[data-ticket-action=review]")->Click();
CHECK(proposals == 0 && source.s.state["ticket"] == 20);
doc->QuerySelector("[data-ticket-action=confirm]")->Click();
CHECK(proposals == 1 && staged.value == 25 && source.s.state["ticket"] == 20 && !popup.is_open());
}
doc->Close();
Rml::RemoveContext("ticket-fixture");
Rml::Shutdown();