mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Rewrite dim test to pass headless
Unfortunately neuters the test a touch, but alas.
This commit is contained in:
@ -119,25 +119,23 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddUntilStep("any column dimmed", () => this.ChildrenOfType<ModColumn>().Any(column => !column.Active.Value));
|
AddUntilStep("any column dimmed", () => this.ChildrenOfType<ModColumn>().Any(column => !column.Active.Value));
|
||||||
|
|
||||||
ModColumn firstDimmed = null;
|
ModColumn lastColumn = null;
|
||||||
ModPanel firstPanel = 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);
|
var lastDimContainer = this.ChildrenOfType<ModSelectScreen.ColumnDimContainer>().Last();
|
||||||
firstPanel = firstDimmed.ChildrenOfType<ModPanel>().First();
|
lastColumn = lastDimContainer.Column;
|
||||||
InputManager.MoveMouseTo(firstPanel);
|
lastDimContainer.RequestScroll?.Invoke(lastDimContainer);
|
||||||
|
});
|
||||||
|
AddUntilStep("column undimmed", () => lastColumn.Active.Value);
|
||||||
|
|
||||||
|
AddStep("click panel", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(lastColumn.ChildrenOfType<ModPanel>().First());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
AddUntilStep("column undimmed", () => firstDimmed.Active.Value);
|
AddUntilStep("panel selected", () => lastColumn.ChildrenOfType<ModPanel>().First().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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -394,7 +394,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ColumnDimContainer : Container
|
internal class ColumnDimContainer : Container
|
||||||
{
|
{
|
||||||
public ModColumn Column { get; }
|
public ModColumn Column { get; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user