use benilla_ui::script::{ QuadContent, ScriptValue, SelectionRequest, SoundRequest, UiScript, UnitState, }; use super::test_ui::{hover, load_ui as load_xml, unhover}; /// The unit frames' production load prefix (ui_script/mod.rs order): fonts + UIParent + /// tooltip, then the dropdown kit + unit popups the frames' DropDown children initialize into. fn load_unit_frames(s: &UiScript) { // The app runs the real `Interface\FrameXML\GlobalStrings.lua` off the player's chain BEFORE // any XML (`load_global_strings`), so the fixture names it too. This used to be a single // hand-set `DEAD = "Dead"`, which was enough while the frames were OUR transcription: ours // carried `X = X or "…"` fallbacks and hard literals for everything else. The reference's own // files carry none, and they resolve GlobalStrings at LOAD in three separate places — // `CombatFeedback.lua` l.7-17 builds the whole `CombatFeedbackText` table out of them // (`TEXT(ABSORB)`, `TEXT(MISS)`, …), `UnitFrame.lua` l.1-6 builds `ManaBarColor`'s prefixes // the same way, and `UnitFrame_OnEnter` l.60/63 passes `PARTY_OPTIONS_LABEL` / // `PLAYER_OPTIONS_LABEL` straight into `GameTooltip:SetText`, which raises on nil rather than // drawing an empty plate. Hand-setting the union of those is a second copy of the reference's // own file; naming the file is the only version that cannot drift. (`DEAD` is l.898 of it.) load_xml(s, "Interface\\FrameXML\\GlobalStrings.lua"); load_xml(s, "Fonts.xml"); load_xml(s, "UIParent.xml"); // The bars' numerals machinery (decision 1082), which the manifest loads immediately ahead of // UnitFrames.xml and which every bar's OnLoad wires into since 1143. load_xml(s, "Interface\\FrameXML\\TextStatusBar.lua"); load_xml(s, "Interface\\FrameXML\\TextStatusBar.xml"); load_xml(s, "GameTooltip.xml"); load_xml(s, "Interface\\FrameXML\\UIDropDownMenu.xml"); load_xml(s, "UnitPopup.xml"); load_xml(s, "Interface\\FrameXML\\BuffFrame.xml"); load_xml(s, "Interface\\FrameXML\\UnitFrame.xml"); load_xml(s, "Interface\\FrameXML\\CombatFeedback.xml"); load_xml(s, "Interface\\FrameXML\\PlayerFrame.xml"); load_xml(s, "Interface\\FrameXML\\PartyFrame.xml"); load_xml(s, "Interface\\FrameXML\\TargetFrame.xml"); load_xml(s, "Interface\\FrameXML\\PetFrame.xml"); } /// Load the real `assets/ui/UnitFrames.xml` (the shipped default UI) into a bare engine and /// drive it with synthetic snapshots — the whole slice-1 chain minus Bevy: template expansion, /// StatusBar fill, the Era event set, the target frame's hide/show lifecycle, and the async /// name arriving via UNIT_NAME_UPDATE. #[test] fn shipped_unit_frames_drive_end_to_end() { let mut s = UiScript::new().unwrap(); s.set_screen_size(1024.0, 768.0); load_unit_frames(&s); assert!(s.errors().is_empty(), "script errors: {:?}", s.errors()); // **Only the TARGET frame hides.** Our deleted transcription hid both; the reference hides // exactly one. `PlayerFrame` is a plain top-level `