1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 08:27:23 +08:00

Adjust test to pass

What I think was happening here is that the dump of the accuracy
counter's state was happening too early. The component is loaded
synchronously into the `ISerialisableDrawableContainer` before its
default position is set via the "apply defaults" `ArgonSkin` flow
- so the test needs to wait for that to take place first.
This commit is contained in:
Bartłomiej Dach 2025-01-13 13:04:17 +01:00
parent 8968ab19d9
commit 39a69d6454
No known key found for this signature in database

View File

@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Navigation
string state = string.Empty;
AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType<ArgonAccuracyCounter>().Any(counter => counter.IsLoaded));
AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType<ArgonAccuracyCounter>().Any(counter => counter.Position != new Vector2()));
AddStep("dump state of accuracy meter", () => state = JsonConvert.SerializeObject(Game.ChildrenOfType<ArgonAccuracyCounter>().First().CreateSerialisedInfo()));
AddStep("add any component", () => Game.ChildrenOfType<SkinComponentToolbox.ToolboxComponentButton>().First().TriggerClick());
AddStep("undo", () =>
@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual.Navigation
string state = string.Empty;
AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType<ArgonAccuracyCounter>().Any(counter => counter.IsLoaded));
AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType<ArgonAccuracyCounter>().Any(counter => counter.Position != new Vector2()));
AddStep("dump state of accuracy meter", () => state = JsonConvert.SerializeObject(Game.ChildrenOfType<ArgonAccuracyCounter>().First().CreateSerialisedInfo()));
AddStep("add any component", () => Game.ChildrenOfType<SkinComponentToolbox.ToolboxComponentButton>().First().TriggerClick());
AddStep("undo", () =>