From a14dede0360836429a954f57b4fc7aec1eb7c9f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Mar 2023 17:18:33 +0900 Subject: [PATCH] Ensure `TestBeatmapCarousel.Items` only returns actually visible items (and in correct order) Turns out that items could be in an order that isn't the same as how things look on the carousel, so this change ensures that for testing purposes they are sorted by Y position. Also uses the `CarouselItem.Visible` flag to ensure that we don't have to wait for drawable fade transitions after a filter operation. --- osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs index deead47770..61a8322ee3 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs @@ -1206,8 +1206,11 @@ namespace osu.Game.Tests.Visual.SongSelect { get { - foreach (var item in Scroll.Children) + foreach (var item in Scroll.Children.OrderBy(c => c.Y)) { + if (item.Item?.Visible != true) + continue; + yield return item; if (item is DrawableCarouselBeatmapSet set)