mirror of https://github.com/ppy/osu
Add test coverage showing commit failure in manage collections dialog
This commit is contained in:
parent
51149343fb
commit
3e308e4c27
|
@ -264,8 +264,9 @@ public void TestCollectionRenamedExternal()
|
|||
assertCollectionName(1, "First");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCollectionRenamedOnTextChange()
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void TestCollectionRenamedOnTextChange(bool commitWithEnter)
|
||||
{
|
||||
BeatmapCollection first = null!;
|
||||
DrawableCollectionListItem firstItem = null!;
|
||||
|
@ -293,9 +294,19 @@ public void TestCollectionRenamedOnTextChange()
|
|||
AddStep("change first collection name", () =>
|
||||
{
|
||||
firstItem.ChildrenOfType<TextBox>().First().Text = "First";
|
||||
InputManager.Key(Key.Enter);
|
||||
});
|
||||
|
||||
if (commitWithEnter)
|
||||
AddStep("commit via enter", () => InputManager.Key(Key.Enter));
|
||||
else
|
||||
{
|
||||
AddStep("commit via click away", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(firstItem.ScreenSpaceDrawQuad.TopLeft - new Vector2(10));
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
}
|
||||
|
||||
AddUntilStep("collection has new name", () => first.Name == "First");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue