1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 19:36:07 +08:00

reset popover at the end of sample tests

This commit is contained in:
OliBomby 2023-06-01 09:00:59 +02:00
parent aa52d86ea3
commit e709390052

View File

@ -121,7 +121,6 @@ namespace osu.Game.Tests.Visual.Editing
[Test] [Test]
public void TestSamplePointPiece() public void TestSamplePointPiece()
{ {
SamplePointPiece samplePointPiece;
SamplePointPiece.SampleEditPopover popover = null!; SamplePointPiece.SampleEditPopover popover = null!;
AddStep("add circle", () => AddStep("add circle", () =>
@ -140,7 +139,7 @@ namespace osu.Game.Tests.Visual.Editing
AddStep("open hitsound popover", () => AddStep("open hitsound popover", () =>
{ {
samplePointPiece = this.ChildrenOfType<SamplePointPiece>().Single(); var samplePointPiece = this.ChildrenOfType<SamplePointPiece>().Single();
InputManager.MoveMouseTo(samplePointPiece); InputManager.MoveMouseTo(samplePointPiece);
InputManager.PressButton(MouseButton.Left); InputManager.PressButton(MouseButton.Left);
InputManager.ReleaseButton(MouseButton.Left); InputManager.ReleaseButton(MouseButton.Left);
@ -184,13 +183,20 @@ namespace osu.Game.Tests.Visual.Editing
}); });
AddAssert("volume changed", () => EditorBeatmap.HitObjects.First().Samples.All(o => o.Volume == 30)); AddAssert("volume changed", () => EditorBeatmap.HitObjects.First().Samples.All(o => o.Volume == 30));
AddStep("close popover", () =>
{
InputManager.MoveMouseTo(popover, new Vector2(200, 0));
InputManager.PressButton(MouseButton.Left);
InputManager.ReleaseButton(MouseButton.Left);
popover = null;
});
} }
[Test] [Test]
public void TestNodeSamplePointPiece() public void TestNodeSamplePointPiece()
{ {
Slider slider = null!; Slider slider = null!;
SamplePointPiece samplePointPiece;
SamplePointPiece.SampleEditPopover popover = null!; SamplePointPiece.SampleEditPopover popover = null!;
AddStep("add slider", () => AddStep("add slider", () =>
@ -215,7 +221,7 @@ namespace osu.Game.Tests.Visual.Editing
AddStep("open slider end hitsound popover", () => AddStep("open slider end hitsound popover", () =>
{ {
samplePointPiece = this.ChildrenOfType<NodeSamplePointPiece>().Last(); var samplePointPiece = this.ChildrenOfType<NodeSamplePointPiece>().Last();
InputManager.MoveMouseTo(samplePointPiece); InputManager.MoveMouseTo(samplePointPiece);
InputManager.PressButton(MouseButton.Left); InputManager.PressButton(MouseButton.Left);
InputManager.ReleaseButton(MouseButton.Left); InputManager.ReleaseButton(MouseButton.Left);
@ -259,6 +265,14 @@ namespace osu.Game.Tests.Visual.Editing
}); });
AddAssert("volume changed", () => slider.NodeSamples[1].All(o => o.Volume == 30)); AddAssert("volume changed", () => slider.NodeSamples[1].All(o => o.Volume == 30));
AddStep("close popover", () =>
{
InputManager.MoveMouseTo(popover, new Vector2(200, 0));
InputManager.PressButton(MouseButton.Left);
InputManager.ReleaseButton(MouseButton.Left);
popover = null;
});
} }
} }
} }