Skip to content

Commit

Permalink
Fix tests clicking wrong delete buttons due to internal drawable orde…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
peppy committed Nov 14, 2024
1 parent 17b1888 commit d66daf1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,21 @@ public void TestRemoveCollectionViaButton()

AddStep("click first delete button", () =>
{
InputManager.MoveMouseTo(dialog.ChildrenOfType<DrawableCollectionListItem.DeleteButton>().First(), new Vector2(5, 0));
InputManager.MoveMouseTo(dialog
.ChildrenOfType<DrawableCollectionListItem>().Single(i => i.Model.Value.Name == "1")
.ChildrenOfType<DrawableCollectionListItem.DeleteButton>().Single(), new Vector2(5, 0));
InputManager.Click(MouseButton.Left);
});

AddAssert("dialog not displayed", () => dialogOverlay.CurrentDialog == null);
assertCollectionCount(1);
assertCollectionName(0, "2");

AddStep("click first delete button", () =>
AddStep("click second delete button", () =>
{
InputManager.MoveMouseTo(dialog.ChildrenOfType<DrawableCollectionListItem.DeleteButton>().First(), new Vector2(5, 0));
InputManager.MoveMouseTo(dialog
.ChildrenOfType<DrawableCollectionListItem>().Single(i => i.Model.Value.Name == "2")
.ChildrenOfType<DrawableCollectionListItem.DeleteButton>().Single(), new Vector2(5, 0));
InputManager.Click(MouseButton.Left);
});

Expand Down Expand Up @@ -310,7 +314,7 @@ public void TestCollectionRenamedOnTextChange(bool commitWithEnter)

AddStep("focus first collection", () =>
{
InputManager.MoveMouseTo(firstItem = dialog.ChildrenOfType<DrawableCollectionListItem>().First());
InputManager.MoveMouseTo(firstItem = dialog.ChildrenOfType<DrawableCollectionListItem>().Single(i => i.Model.Value.Name == "1"));
InputManager.Click(MouseButton.Left);
});

Expand Down

0 comments on commit d66daf1

Please sign in to comment.