1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Rewrite dim test to pass headless

Unfortunately neuters the test a touch, but alas.
This commit is contained in:
Bartłomiej Dach 2022-04-26 23:11:38 +02:00
parent 921e8af3b0
commit a849bfcf60
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 14 additions and 16 deletions

View File

@ -119,25 +119,23 @@ namespace osu.Game.Tests.Visual.UserInterface
AddUntilStep("any column dimmed", () => this.ChildrenOfType<ModColumn>().Any(column => !column.Active.Value));
ModColumn firstDimmed = null;
ModPanel firstPanel = null;
ModColumn lastColumn = null;
AddStep("click first panel on dimmed column", () =>
AddAssert("last column dimmed", () => !this.ChildrenOfType<ModColumn>().Last().Active.Value);
AddStep("request scroll to last column", () =>
{
firstDimmed = this.ChildrenOfType<ModColumn>().First(column => !column.Active.Value);
firstPanel = firstDimmed.ChildrenOfType<ModPanel>().First();
InputManager.MoveMouseTo(firstPanel);
var lastDimContainer = this.ChildrenOfType<ModSelectScreen.ColumnDimContainer>().Last();
lastColumn = lastDimContainer.Column;
lastDimContainer.RequestScroll?.Invoke(lastDimContainer);
});
AddUntilStep("column undimmed", () => lastColumn.Active.Value);
AddStep("click panel", () =>
{
InputManager.MoveMouseTo(lastColumn.ChildrenOfType<ModPanel>().First());
InputManager.Click(MouseButton.Left);
});
AddUntilStep("column undimmed", () => firstDimmed.Active.Value);
AddAssert("panel not selected", () => !firstPanel.Active.Value);
AddStep("click panel again", () =>
{
InputManager.MoveMouseTo(firstPanel);
InputManager.Click(MouseButton.Left);
});
AddUntilStep("panel selected", () => firstPanel.Active.Value);
AddUntilStep("panel selected", () => lastColumn.ChildrenOfType<ModPanel>().First().Active.Value);
}
[Test]

View File

@ -394,7 +394,7 @@ namespace osu.Game.Overlays.Mods
}
}
private class ColumnDimContainer : Container
internal class ColumnDimContainer : Container
{
public ModColumn Column { get; }