Skip to content

Commit

Permalink
Update remaining tests to use new base class (and tidy up V2 suffixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Aug 14, 2024
1 parent 1665d9a commit e603888
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void load()
}
};

AddSliderStep("change relative width", 0, 1f, 0.5f, v =>
AddSliderStep("change relative width", 0, 1f, 1f, v =>
{
if (resizeContainer != null)
resizeContainer.Width = v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

namespace osu.Game.Tests.Visual.SongSelectV2
{
[TestFixture]
public partial class TestSceneBeatmapInfoWedgeV2 : OsuTestScene
public partial class TestSceneBeatmapInfoWedge : SongSelectComponentsTestScene
{
private RulesetStore rulesets = null!;
private TestBeatmapInfoWedgeV2 infoWedge = null!;
Expand All @@ -33,6 +32,13 @@ private void load(RulesetStore rulesets)
this.rulesets = rulesets;
}

public override void SetUpSteps()
{
base.SetUpSteps();

AddStep("reset mods", () => SelectedMods.SetDefault());
}

protected override void LoadComplete()
{
base.LoadComplete();
Expand Down Expand Up @@ -107,12 +113,6 @@ private void testBeatmapLabels(Ruleset ruleset)
AddAssert("check artist", () => infoWedge.Info!.ArtistLabel.Current.Value == $"{ruleset.ShortName}Artist");
}

[SetUpSteps]
public void SetUpSteps()
{
AddStep("reset mods", () => SelectedMods.SetDefault());
}

[Test]
public void TestTruncation()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
Expand All @@ -26,7 +25,7 @@

namespace osu.Game.Tests.Visual.SongSelectV2
{
public partial class TestSceneLeaderboardScoreV2 : OsuTestScene
public partial class TestSceneLeaderboardScore : SongSelectComponentsTestScene
{
[Cached]
private OverlayColourProvider colourProvider { get; set; } = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
Expand All @@ -36,19 +35,6 @@ public partial class TestSceneLeaderboardScoreV2 : OsuTestScene

private FillFlowContainer? fillFlow;
private OsuSpriteText? drawWidthText;
private float relativeWidth;

[BackgroundDependencyLoader]
private void load()
{
// TODO: invalidation seems to be one-off when clicking slider to a certain value, so drag for now
// doesn't seem to happen in-game (when toggling window mode)
AddSliderStep("change relative width", 0, 1f, 0.6f, v =>
{
relativeWidth = v;
if (fillFlow != null) fillFlow.Width = v;
});
}

[Test]
public void TestSheared()
Expand All @@ -59,7 +45,6 @@ public void TestSheared()
{
fillFlow = new FillFlowContainer
{
Width = relativeWidth,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Expand Down Expand Up @@ -94,7 +79,6 @@ public void TestNonSheared()
{
fillFlow = new FillFlowContainer
{
Width = relativeWidth,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Expand All @@ -118,8 +102,7 @@ public void TestNonSheared()
});
}

[SetUpSteps]
public void SetUpSteps()
public override void SetUpSteps()
{
AddToggleStep("toggle scoring mode", v => config.SetValue(OsuSetting.ScoreDisplayMode, v ? ScoringMode.Classic : ScoringMode.Standardised));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

namespace osu.Game.Tests.Visual.SongSelectV2
{
public partial class TestSceneSongSelectV2 : ScreenTestScene
public partial class TestSceneSongSelect : ScreenTestScene
{
[Cached]
private readonly ScreenFooter screenScreenFooter;

[Cached]
private readonly OsuLogo logo;

public TestSceneSongSelectV2()
public TestSceneSongSelect()
{
Children = new Drawable[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace osu.Game.Tests.Visual.SongSelectV2
{
public partial class TestSceneSongSelectV2Navigation : OsuGameTestScene
public partial class TestSceneSongSelectNavigation : OsuGameTestScene
{
public override void SetUpSteps()
{
Expand Down

0 comments on commit e603888

Please sign in to comment.