1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 12:17:43 +08:00

Simplify fetching DrawableChannel in ChatOverlayV2 test

This commit is contained in:
Jai Sharma 2022-05-09 00:26:00 +01:00
parent 5f80e344c3
commit c221058f0f

View File

@ -365,7 +365,7 @@ namespace osu.Game.Tests.Visual.Online
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
AddStep("Click listing", () => clickDrawable(chatOverlay.ChildrenOfType<ChannelListing>().Single()));
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
AddStep("Click drawable channel", () => clickDrawable(chatOverlay.ChildrenOfType<ChatOverlayDrawableChannel>().Single()));
AddStep("Click drawable channel", () => clickDrawable(currentDrawableChannel));
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
AddStep("Click channel list", () => clickDrawable(chatOverlay.ChildrenOfType<ChannelList>().Single()));
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
@ -381,8 +381,8 @@ namespace osu.Game.Tests.Visual.Online
private Visibility loadingVisibility =>
chatOverlay.ChildrenOfType<LoadingLayer>().Single().State.Value;
private ChatOverlayDrawableChannel currentDrawableChannel =>
chatOverlay.ChildrenOfType<Container<ChatOverlayDrawableChannel>>().Single().Child;
private DrawableChannel currentDrawableChannel =>
chatOverlay.ChildrenOfType<DrawableChannel>().Single();
private ChannelListItem getChannelListItem(Channel channel) =>
chatOverlay.ChildrenOfType<ChannelListItem>().Single(item => item.Channel == channel);