1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:52:55 +08:00

Add visual test for failed S display

This commit is contained in:
Joseph Madamba 2024-03-06 22:48:54 -08:00
parent e0fe33a7a7
commit 56caf19350

View File

@ -88,8 +88,21 @@ namespace osu.Game.Tests.Visual.Ranking
AddAssert("play time not displayed", () => !this.ChildrenOfType<ExpandedPanelMiddleContent.PlayedOnText>().Any()); AddAssert("play time not displayed", () => !this.ChildrenOfType<ExpandedPanelMiddleContent.PlayedOnText>().Any());
} }
private void showPanel(ScoreInfo score) => [TestCase(false)]
Child = new ExpandedPanelMiddleContentContainer(score); [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) private BeatmapInfo createTestBeatmap([NotNull] RealmUser author)
{ {
@ -107,7 +120,7 @@ namespace osu.Game.Tests.Visual.Ranking
private partial class ExpandedPanelMiddleContentContainer : Container private partial class ExpandedPanelMiddleContentContainer : Container
{ {
public ExpandedPanelMiddleContentContainer(ScoreInfo score) public ExpandedPanelMiddleContentContainer(ScoreInfo score, bool withFlair)
{ {
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
@ -119,7 +132,7 @@ namespace osu.Game.Tests.Visual.Ranking
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("#444"), Colour = Color4Extensions.FromHex("#444"),
}, },
new ExpandedPanelMiddleContent(score) new ExpandedPanelMiddleContent(score, withFlair)
}; };
} }
} }