mirror of https://github.com/ppy/osu
Use alpha directly for checking visibility in test
`IsPresent` is no longer synonymous with being visible, after applying the fix to the issue in question.
This commit is contained in:
parent
585aa87c53
commit
2b23c8eabd
|
@ -205,13 +205,16 @@ public void TestDownloadButtonHiddenWhenBeatmapExists()
|
|||
{
|
||||
createPlaylist(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo);
|
||||
|
||||
AddAssert("download button hidden", () => !playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().Single().IsPresent);
|
||||
assertDownloadButtonVisible(false);
|
||||
|
||||
AddStep("delete beatmap set", () => manager.Delete(manager.QueryBeatmapSets(_ => true).Single()));
|
||||
AddUntilStep("download button shown", () => playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().Single().IsPresent);
|
||||
assertDownloadButtonVisible(true);
|
||||
|
||||
AddStep("undelete beatmap set", () => manager.Undelete(manager.QueryBeatmapSets(_ => true).Single()));
|
||||
AddUntilStep("download button hidden", () => !playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().Single().IsPresent);
|
||||
assertDownloadButtonVisible(false);
|
||||
|
||||
void assertDownloadButtonVisible(bool visible) => AddUntilStep($"download button {(visible ? "shown" : "hidden")}",
|
||||
() => playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().Single().Alpha == (visible ? 1 : 0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
Loading…
Reference in New Issue