diff --git a/osu.Game.Tests/Visual/Multiplayer/TestMultiplayerModLoading.cs b/osu.Game.Tests/Visual/Multiplayer/TestMultiplayerModLoading.cs deleted file mode 100644 index 7c2353513d..0000000000 --- a/osu.Game.Tests/Visual/Multiplayer/TestMultiplayerModLoading.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. -using System; -using NUnit.Framework; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Osu.Mods; -using osu.Game.Screens.Select; - -namespace osu.Game.Tests.Visual.Multiplayer -{ - public class TestMultiplayerModLoading : OsuGameTestScene - { - [SetUp] - public void SetUp() => Schedule(() => - { - SelectedMods.Value = Array.Empty(); - }); - - /// - /// This is a regression test that tests whether a singleplayer mod can transfer over to a multiplayer screen. - /// It should not carry over from these screens, prevents regression on https://github.com/ppy/osu/pull/17352 - /// - [Test] - public void TestSingleplayerModsDontCarryToMultiplayerScreens() - { - PushAndConfirm(() => new PlaySongSelect()); - - // Select Mods while a "singleplayer" screen is active - var osuAutomationMod = new OsuModAutoplay(); - var expectedMods = new[] { osuAutomationMod }; - - AddStep("Toggle on the automation Mod.", () => { SelectedMods.Value = expectedMods; }); - AddAssert("Mods are loaded before the multiplayer screen is pushed.", () => SelectedMods.Value == expectedMods); - - PushAndConfirm(() => new TestMultiplayerComponents()); - AddAssert("Mods are Empty After A Multiplayer Screen Loads", () => SelectedMods.Value.Count == 0); - - AddStep("Retoggle on the automation Mod.", () => { SelectedMods.Value = expectedMods; }); - AddAssert("Mods are loaded before the playlist screen is pushed", () => SelectedMods.Value == expectedMods); - - // TODO: Implement TestPlaylistComponents? - //PushAndConfirm(() => new TestPlaylistComponents()); - //AddAssert("Mods are Empty After Playlist Screen Loads", () => !SelectedMods.Value.Any()); - } - } -} diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index f2e6aa1e16..7e1ff08678 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -262,6 +262,20 @@ namespace osu.Game.Tests.Visual.Navigation exitViaBackButtonAndConfirm(); } + [Test] + public void TestModsResetOnEnteringMultiplayer() + { + var osuAutomationMod = new OsuModAutoplay(); + + AddStep("Enable autoplay", () => { Game.SelectedMods.Value = new[] { osuAutomationMod }; }); + + PushAndConfirm(() => new Screens.OnlinePlay.Multiplayer.Multiplayer()); + AddUntilStep("Mods are removed", () => SelectedMods.Value.Count == 0); + + AddStep("Return to menu", () => Game.ScreenStack.CurrentScreen.Exit()); + AddUntilStep("Mods are restored", () => Game.SelectedMods.Value.Contains(osuAutomationMod)); + } + [Test] public void TestExitMultiWithEscape() {