mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 11:02:57 +08:00
Merge pull request #7773 from ProTheory8/mod-test-improvements
Improve mod settings tests
This commit is contained in:
commit
e6111a1888
@ -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,19 +58,21 @@ 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);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCustomisationOpensOnModSelect()
|
||||
public void TestCustomisationMenuVisibility()
|
||||
{
|
||||
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);
|
||||
AddStep("deselect mod", () => modSelect.SelectMod(testCustomisableAutoOpenMod));
|
||||
AddAssert("Customisation closed", () => modSelect.ModSettingsContainer.Alpha == 0);
|
||||
}
|
||||
|
||||
private void createModSelect()
|
||||
@ -86,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;
|
||||
|
Loading…
Reference in New Issue
Block a user