From 56caf1935043112ec13c5d0b1d43e9d23b8d1f7e Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 6 Mar 2024 22:48:54 -0800 Subject: [PATCH] Add visual test for failed S display --- .../TestSceneExpandedPanelMiddleContent.cs | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneExpandedPanelMiddleContent.cs b/osu.Game.Tests/Visual/Ranking/TestSceneExpandedPanelMiddleContent.cs index d71c72f4ec..ceb2d4927c 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneExpandedPanelMiddleContent.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneExpandedPanelMiddleContent.cs @@ -88,8 +88,21 @@ namespace osu.Game.Tests.Visual.Ranking AddAssert("play time not displayed", () => !this.ChildrenOfType().Any()); } - private void showPanel(ScoreInfo score) => - Child = new ExpandedPanelMiddleContentContainer(score); + [TestCase(false)] + [TestCase(true)] + public void TestFailedSDisplay(bool withFlair) + { + AddStep("show failed S score", () => + { + var score = TestResources.CreateTestScoreInfo(createTestBeatmap(new RealmUser())); + score.Rank = ScoreRank.A; + score.Accuracy = 0.975; + showPanel(score, withFlair); + }); + } + + private void showPanel(ScoreInfo score, bool withFlair = false) => + Child = new ExpandedPanelMiddleContentContainer(score, withFlair); private BeatmapInfo createTestBeatmap([NotNull] RealmUser author) { @@ -107,7 +120,7 @@ namespace osu.Game.Tests.Visual.Ranking private partial class ExpandedPanelMiddleContentContainer : Container { - public ExpandedPanelMiddleContentContainer(ScoreInfo score) + public ExpandedPanelMiddleContentContainer(ScoreInfo score, bool withFlair) { Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -119,7 +132,7 @@ namespace osu.Game.Tests.Visual.Ranking RelativeSizeAxes = Axes.Both, Colour = Color4Extensions.FromHex("#444"), }, - new ExpandedPanelMiddleContent(score) + new ExpandedPanelMiddleContent(score, withFlair) }; } }