mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
Fix textbox focus test in ChatOverlayV2
This commit is contained in:
parent
2163a78b7f
commit
bd68ffa805
@ -365,19 +365,19 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TextBoxRetainsFocus()
|
||||
public void TestTextBoxRetainsFocus()
|
||||
{
|
||||
AddStep("Show overlay", () => chatOverlay.Show());
|
||||
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
|
||||
AddStep("Join channel 1", () => channelManager.JoinChannel(testChannel1));
|
||||
AddStep("Select channel 1", () => clickDrawable(getChannelListItem(testChannel1)));
|
||||
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
|
||||
AddStep("Click drawable channel", () => clickDrawable(currentDrawableChannel));
|
||||
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
|
||||
AddStep("Click selector", () => clickDrawable(chatOverlay.ChildrenOfType<ChannelListSelector>().Single()));
|
||||
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(currentDrawableChannel));
|
||||
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
|
||||
AddStep("Click channel list", () => clickDrawable(chatOverlay.ChildrenOfType<ChannelList>().Single()));
|
||||
AddAssert("TextBox is focused", () => InputManager.FocusedDrawable == chatOverlayTextBox);
|
||||
AddStep("Click top bar", () => clickDrawable(chatOverlay.ChildrenOfType<ChatOverlayTopBar>().Single()));
|
||||
|
@ -242,12 +242,12 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
// null channel denotes that we should be showing the listing.
|
||||
currentChannelContainer.Clear(false);
|
||||
channelListing.State.Value = Visibility.Visible;
|
||||
channelListing.Show();
|
||||
textBar.ShowSearch.Value = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
channelListing.State.Value = Visibility.Hidden;
|
||||
channelListing.Hide();
|
||||
textBar.ShowSearch.Value = false;
|
||||
|
||||
if (loadedChannels.ContainsKey(newChannel))
|
||||
@ -299,6 +299,7 @@ namespace osu.Game.Overlays
|
||||
foreach (var channel in leftChannels)
|
||||
{
|
||||
channelList.RemoveChannel(channel);
|
||||
|
||||
if (loadedChannels.ContainsKey(channel))
|
||||
{
|
||||
ChatOverlayDrawableChannel loaded = loadedChannels[channel];
|
||||
|
Loading…
Reference in New Issue
Block a user