Files
HellionChat/HellionChat/SelfTests/QuickPickerSelfTestStep.cs
T
JonKazama-Hellion a42cc2a97e test(selftest): pin v1.5.4 crossfade and quick-picker contracts
ThemeCrossfadeSelfTestStep walks Switch -> crossfade-observed ->
mid-crossfade-switch -> crossfade-end -> restore using
TryGetActiveCrossfade, returns Waiting frame-by-frame and Pass after
the restore concludes. The mid-switch phase fires a second Switch
within ~100ms of the first observed crossfade and asserts the lerped
value is neither identity-from nor identity-to, exercising the
ArmCrossfade mid-flight-origin override.

QuickPickerSelfTestStep verifies the three new resource strings, the
built-in theme floor (>=10), and Config.Tabs non-empty.
2026-05-20 16:21:29 +02:00

65 lines
2.0 KiB
C#

using Dalamud.Bindings.ImGui;
using Dalamud.Plugin.SelfTest;
using HellionChat.Resources;
namespace HellionChat.SelfTests;
// Verifies the v1.5.4 PM-2 quick-picker plumbing without rendering:
// resource strings resolve, the theme registry yields the expected
// minimum built-in count, and Config.Tabs is populated.
internal sealed class QuickPickerSelfTestStep : ISelfTestStep
{
private readonly Plugin plugin;
public QuickPickerSelfTestStep(Plugin plugin)
{
this.plugin = plugin;
}
public string Name => "Hellion Chat - Quick picker plumbing";
public SelfTestStepResult RunStep()
{
if (string.IsNullOrWhiteSpace(HellionStrings.Settings_QuickPicker_Tooltip))
{
ImGui.Text("Settings_QuickPicker_Tooltip is empty in the active locale.");
return SelfTestStepResult.Fail;
}
if (string.IsNullOrWhiteSpace(HellionStrings.Settings_QuickPicker_Themes_Header))
{
ImGui.Text("Settings_QuickPicker_Themes_Header is empty in the active locale.");
return SelfTestStepResult.Fail;
}
if (string.IsNullOrWhiteSpace(HellionStrings.Settings_QuickPicker_Tabs_Header))
{
ImGui.Text("Settings_QuickPicker_Tabs_Header is empty in the active locale.");
return SelfTestStepResult.Fail;
}
var registry = this.plugin.ThemeRegistry;
if (registry is null)
{
ImGui.Text("ThemeRegistry not resolved.");
return SelfTestStepResult.Fail;
}
var builtIns = registry.AllBuiltIns().ToList();
if (builtIns.Count < 10)
{
ImGui.Text($"Expected at least 10 built-in themes, found {builtIns.Count}.");
return SelfTestStepResult.Fail;
}
var tabs = Plugin.Config.Tabs;
if (tabs is null || tabs.Count == 0)
{
ImGui.Text("Config.Tabs is empty.");
return SelfTestStepResult.Fail;
}
return SelfTestStepResult.Pass;
}
public void CleanUp() { }
}