1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Open mod select in a more reliable way

This commit is contained in:
Bartłomiej Dach 2020-02-09 14:39:27 +01:00
parent 590429b43b
commit 404cb61342

View File

@ -38,8 +38,8 @@ namespace osu.Game.Tests.Visual.UserInterface
public void TestButtonShowsOnCustomisableMod()
{
createModSelect();
openModSelect();
AddStep("open", () => modSelect.Show());
AddAssert("button disabled", () => !modSelect.CustomiseButton.Enabled.Value);
AddUntilStep("wait for button load", () => modSelect.ButtonsLoaded);
AddStep("select mod", () => modSelect.SelectMod(testCustomisableMod));
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddAssert("mods still active", () => SelectedMods.Value.Count == 1);
AddStep("open", () => modSelect.Show());
openModSelect();
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
}
@ -66,8 +66,8 @@ namespace osu.Game.Tests.Visual.UserInterface
public void TestAutoOpenOnModSelect()
{
createModSelect();
openModSelect();
AddStep("open", () => modSelect.Show());
AddAssert("Customisation closed", () => modSelect.ModSettingsContainer.Alpha == 0);
AddStep("select mod", () => modSelect.SelectMod(testCustomisableAutoOpenMod));
AddAssert("Customisation opened", () => modSelect.ModSettingsContainer.Alpha == 1);
@ -88,6 +88,12 @@ namespace osu.Game.Tests.Visual.UserInterface
});
}
private void openModSelect()
{
AddStep("open", () => modSelect.Show());
AddUntilStep("wait for ready", () => modSelect.State.Value == Visibility.Visible && modSelect.ButtonsLoaded);
}
private class TestModSelectOverlay : ModSelectOverlay
{
public new Container ModSettingsContainer => base.ModSettingsContainer;