An estimated day baseline took its scale from the newest sample, so use from the web lowered the budget while today stayed within it. It now takes the scale from the first sample at or after the day start (D7). The stale sample warning moves into the "used" caption, so tiles of one kind keep the same rows (D8). Both answer the first review of #15. Refs #13
This commit is contained in:
@@ -186,6 +186,19 @@ public sealed class HeadlessTests
|
||||
Save(budgetPanel, $"budget-1280x1000-{theme}-{name}.png");
|
||||
}
|
||||
}
|
||||
budgetModel.Snapshot = budgetSnapshot with { Providers = budgetSnapshot.Providers.Select(p => p.Provider == Provider.Codex
|
||||
? p with { Windows = p.Windows.Select(w => w with { Window = w.Window with { SampleTime = budgetClock.GetUtcNow().AddMinutes(-15) } }).ToArray() }
|
||||
: p).ToArray() };
|
||||
Dispatcher.UIThread.RunJobs();
|
||||
Assert.Equal(longRows, Rows(Provider.Claude)); Assert.Equal(longRows, Rows(Provider.Codex));
|
||||
var staleWeek = budgetPanel.GetVisualDescendants().OfType<Border>().Single(b => b.Name == "LimitTile-Codex-week");
|
||||
var freshWeek = budgetPanel.GetVisualDescendants().OfType<Border>().Single(b => b.Name == "LimitTile-Claude-week");
|
||||
var staleUsed = staleWeek.GetVisualDescendants().OfType<TextBlock>().Single(t => t.Name == "Used");
|
||||
Assert.Equal("used · ⚠ sample 15 min old", staleUsed.Text);
|
||||
Assert.Equal(12, staleUsed.FontSize); Assert.Equal("#ff898781", staleUsed.Foreground?.ToString());
|
||||
Assert.Equal("used", freshWeek.GetVisualDescendants().OfType<TextBlock>().Single(t => t.Name == "Used").Text);
|
||||
budgetPanel.GetVisualDescendants().OfType<ScrollViewer>().First().Offset = default;
|
||||
SaveThemes(budgetPanel, "budget-stale-1280x1000");
|
||||
budgetModel.History = new([], [], [], [], []);
|
||||
budgetModel.Snapshot = budgetSnapshot with { Providers = budgetSnapshot.Providers.Select(p =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user