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:
parent
921e8af3b0
commit
a849bfcf60
@ -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]
|
||||
|
@ -394,7 +394,7 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
}
|
||||
|
||||
private class ColumnDimContainer : Container
|
||||
internal class ColumnDimContainer : Container
|
||||
{
|
||||
public ModColumn Column { get; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user