1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Add test coverage for crashing on empty beatmap

This commit is contained in:
Bartłomiej Dach 2023-12-04 13:50:52 +01:00
parent 7deff70b4a
commit d3e94cd5bf
No known key found for this signature in database

View File

@ -12,9 +12,11 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Framework.Threading;
using osu.Game.Online.API;
using osu.Game.Overlays.Settings;
using osu.Game.Overlays.SkinEditor;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Edit.Components;
using osu.Game.Screens.Play;
@ -259,6 +261,19 @@ namespace osu.Game.Tests.Visual.Navigation
AddAssert("editor sidebars not empty", () => skinEditor.ChildrenOfType<EditorSidebar>().SelectMany(sidebar => sidebar.Children).Count(), () => Is.GreaterThan(0));
}
[Test]
public void TestOpenSkinEditorGameplaySceneOnBeatmapWithNoObjects()
{
AddStep("set dummy beatmap", () => Game.Beatmap.SetDefault());
advanceToSongSelect();
AddStep("create empty beatmap", () => Game.BeatmapManager.CreateNew(new OsuRuleset().RulesetInfo, new GuestUser()));
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
openSkinEditor();
switchToGameplayScene();
}
private void advanceToSongSelect()
{
PushAndConfirm(() => songSelect = new TestPlaySongSelect());