Files
WoW-Hybrid-gateway/tests/native_shop_entry_test.lua
praxisandClaude Fable 5.2 7f2139d8d0 Offline test fixtures
883 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

22 lines
1.3 KiB
Lua

local root=arg[1] or '.'
local base=root..'/runtime/continuation-20261113/codex/'
local rel='interface/addons/blizzard_micromenu/mainline/mainmenubarmicrobuttons.lua'
local function read(path)local f=assert(io.open(path,'rb'));local s=f:read('*a');f:close();return s end
local old=read(base..'PTR-feedback-disable/native70334-ui/'..rel)
local new=read(assert(arg[2], 'Pass the freshly prepared native entry child'))
assert(new==old,'Retired fallback preparation changed the original Forever entry')
local a=assert(new:find('StoreMicroButtonMixin = {};',1,true))
local b=assert(new:find('HelpMicroButtonMixin = {};',a,true))
local chunk=new:sub(a,b-1)
assert(not chunk:find('Turtle_ShopUI',1,true) and not chunk:find('ShopFrame_Toggle',1,true))
assert(load(chunk))()
local kiosk=false;Kiosk={IsEnabled=function()return kiosk end}
local calls=0;ToggleStoreUI=function(context)assert(context=='native-context');calls=calls+1 end
C_AddOns={IsAddOnLoaded=function()error('Retired addon state queried')end}
ShopFrame_Toggle=function()error('Retired addon opened')end
local button=setmetatable({}, {__index=StoreMicroButtonMixin})
function button:GetButtonContext()return 'native-context' end
button:OnClick();assert(calls==1)
kiosk=true;button:OnClick();assert(calls==1)
print('PASS: original Forever entry, native context and kiosk policy retained; no addon diversion')