Fix more tests reading in wrong order

This commit is contained in:
Dean Herbert 2024-11-14 14:46:58 +09:00
parent d66daf15a5
commit fea6a54432
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View File

@ -265,6 +265,7 @@ namespace osu.Game.Tests.Visual.Collections
}
[Test]
[Solo]
public void TestCollectionRenamedExternal()
{
BeatmapCollection first = null!;
@ -341,6 +342,6 @@ namespace osu.Game.Tests.Visual.Collections
=> AddUntilStep($"{count} collections shown", () => dialog.ChildrenOfType<DrawableCollectionListItem>().Count() == count + 1); // +1 for placeholder
private void assertCollectionName(int index, string name)
=> AddUntilStep($"item {index + 1} has correct name", () => dialog.ChildrenOfType<DrawableCollectionListItem>().ElementAt(index).ChildrenOfType<TextBox>().First().Text == name);
=> AddUntilStep($"item {index + 1} has correct name", () => dialog.ChildrenOfType<DrawableCollectionList>().Single().OrderedItems.ElementAt(index).ChildrenOfType<TextBox>().First().Text == name);
}
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
@ -29,7 +30,11 @@ namespace osu.Game.Collections
private IDisposable? realmSubscription;
protected override FillFlowContainer<RearrangeableListItem<Live<BeatmapCollection>>> CreateListFillFlowContainer() => new Flow
private Flow flow = null!;
public IEnumerable<Drawable> OrderedItems => flow.FlowingChildren;
protected override FillFlowContainer<RearrangeableListItem<Live<BeatmapCollection>>> CreateListFillFlowContainer() => flow = new Flow
{
DragActive = { BindTarget = DragActive }
};