mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:03:08 +08:00
Fix PlaylistResultsScreen
test failures
As seen: https://github.com/ppy/osu/pull/17252/checks?check_run_id=5545717506 The `PlaylistsResultsScreen` takes a lease on the `Beatmap` bindable when entered. During `SetUp`, the `Beatmap` bindable is reassigned but fails in cases where an existing test instance of the screen hasn't been exited yet. This fix moves the assignment into the `SetUpSteps` function after `base.SetUpSteps` is called which will exit the existing screens first.
This commit is contained in:
parent
7aa3a52ef7
commit
c56df80106
@ -53,11 +53,22 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
userScore.Statistics = new Dictionary<HitResult, int>();
|
||||
|
||||
bindHandler();
|
||||
});
|
||||
|
||||
// beatmap is required to be an actual beatmap so the scores can get their scores correctly calculated for standardised scoring.
|
||||
[SetUpSteps]
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
base.SetUpSteps();
|
||||
|
||||
// Existing test instances of the results screen hold a leased bindable of the beatmap,
|
||||
// so wait for those screens to be cleaned up by the base SetUpSteps before re-assigning
|
||||
AddStep("Create Working Beatmap", () =>
|
||||
{
|
||||
// Beatmap is required to be an actual beatmap so the scores can get their scores correctly calculated for standardised scoring.
|
||||
// else the tests that rely on ordering will fall over.
|
||||
Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestShowWithUserScore()
|
||||
|
Loading…
Reference in New Issue
Block a user